Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mobical.cpp: define MAP_ANONYMOUS if undefined #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

barracuda156
Copy link

Trivial fix for platforms where MAP_ANONYMOUS is not present.

@m-fleury
Copy link
Collaborator

m-fleury commented Jan 7, 2025

Seems to be such an macOS specific thing that even apple provides that ifdef in some places https://github.com/apple/darwin-xnu/blob/0a798f6738bc1db01281fc08ae024145e84df927/bsd/sys/mman.h#L127

@m-fleury
Copy link
Collaborator

m-fleury commented Jan 7, 2025

  1. Can you change your code to:
#ifdef __APPLE__

instead of testing if MAP_ANONYMOUS is defined (this makes it more clear when the variable is not defined).

  1. Can you sign your commit as described in the CONTRIBUTING.md document?

@barracuda156
Copy link
Author

@m-fleury This is not really specific to macOS, I think, though a number of macOS versions are affected (everything before 10.11).
Linux seems to recognize either: https://man7.org/linux/man-pages/man2/mmap.2.html (so at least MAP_ANON is not Apple-only).

Maybe adopt the version from Ruby upstream?
ruby/ruby@c0251c6

@m-fleury
Copy link
Collaborator

m-fleury commented Jan 7, 2025

Right according to this issue, the situation is a mess and we do indeed need both (even though I have no idea CaDiCaL works on any of the machines where only MAP_ANONYMOUS is defined).

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants