Merged
Conversation
| #endif | ||
|
|
||
| /* Sometimes (for example, on FreeBSD) MAP_INHERIT_ZERO is called INHERIT_ZERO */ | ||
| #if !defined(MAP_INHERIT_ZERO) && defined(INHERIT_ZERO) |
Contributor
There was a problem hiding this comment.
Okay, this is one way of doing it. But it breaks a bit if there is a third *BSD calling it INHERIT_ZERO_MAP (or whatever different name)... But I'm not sure what the prettiest way of handling this is anyway...
Contributor
Author
There was a problem hiding this comment.
I don't think there can be a pretty way to handle all possible names. We would just have to add another check for a third name. The best we can do is decide on one name our code uses (MAP_INHERIT_ZERO) and translate all other names to that so that later code can just assume MAP_INHERIT_ZERO.
WesleyRosenblum
approved these changes
Dec 7, 2022
torben-hansen
approved these changes
Dec 7, 2022
goatgoose
approved these changes
Dec 7, 2022
harrisonkaiser
approved these changes
Dec 7, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolved issues:
resolves #3674
Description of changes:
Handle the case where minherit takes "INHERIT_ZERO" instead of "MAP_INHERIT_ZERO".
Callouts
This test duplicates a couple typo fixes from #3670, since that PR deals with OpenBSD, which also hits the path with the typos.
Testing:
I added a basic test for two OSes we know should support minherit, one that uses MAP_INHERIT_ZERO (OpenBSD) and one that uses INHERIT_ZERO (FreeBSD). The OpenBSD version of the test won't get executed until we add an OpenBSD build to the CI, which is blocked by #3670.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.