Skip to content

gh-81652 add MAP_ALIGNED_SUPER FreeBSD and MAP_CONCEAL OpenBSD constants #102191

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

Merged
merged 3 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions Doc/library/mmap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,19 @@ MAP_* Constants
MAP_ANONYMOUS
MAP_POPULATE
MAP_STACK
MAP_ALIGNED_SUPER
MAP_CONCEAL

These are the various flags that can be passed to :meth:`mmap.mmap`. Note that some options might not be present on some systems.
These are the various flags that can be passed to :meth:`mmap.mmap`. :data:`MAP_ALIGNED_SUPER`
is only available at FreeBSD and :data:`MAP_CONCEAL` is only available at OpenBSD. Note
that some options might not be present on some systems.

.. versionchanged:: 3.10
Added MAP_POPULATE constant.
Added :data:`MAP_POPULATE` constant.

.. versionadded:: 3.11
Added MAP_STACK constant.
Added :data:`MAP_STACK` constant.

.. versionadded:: 3.12
Added :data:`MAP_ALIGNED_SUPER` constant.
Added :data:`MAP_CONCEAL` constant.
1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,7 @@ Derek D. Kim
Gihwan Kim
Jan Kim
Taek Joo Kim
Yeojin Kim
Sam Kimbrel
Tomohiko Kinebuchi
James King
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add :data:`mmap.MAP_ALIGNED_SUPER` FreeBSD and :data:`mmap.MAP_CONCEAL`
OpenBSD constants to :mod:`mmap`. Patch by Yeojin Kim.
6 changes: 6 additions & 0 deletions Modules/mmapmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1603,6 +1603,12 @@ mmap_exec(PyObject *module)
// Mostly a no-op on Linux and NetBSD, but useful on OpenBSD
// for stack usage (even on x86 arch)
ADD_INT_MACRO(module, MAP_STACK);
#endif
#ifdef MAP_ALIGNED_SUPER
ADD_INT_MACRO(module, MAP_ALIGNED_SUPER);
#endif
#ifdef MAP_CONCEAL
ADD_INT_MACRO(module, MAP_CONCEAL);
#endif
if (PyModule_AddIntConstant(module, "PAGESIZE", (long)my_getpagesize()) < 0 ) {
return -1;
Expand Down