private copy-on-write mapping, so changes to the contents of the mmap
object will be private to this process, and :const:`MAP_SHARED` creates a
mapping that's shared with all other processes mapping the same areas of
- the file. The default value is :const:`MAP_SHARED`.
+ the file. The default value is :const:`MAP_SHARED`. Some systems have
+ additional possible flags with the full list specified in
+ :ref:`MAP_* constants <map-constants>`.
*prot*, if specified, gives the desired memory protection; the two most
useful values are :const:`PROT_READ` and :const:`PROT_WRITE`, to specify
Availability: Systems with the madvise() system call.
.. versionadded:: 3.8
+
+.. _map-constants:
+
+MAP_* Constants
++++++++++++++++
+
+.. data:: MAP_SHARED
+ MAP_PRIVATE
+ MAP_DENYWRITE
+ MAP_EXECUTABLE
+ MAP_ANON
+ MAP_ANONYMOUS
+ MAP_POPULATE
+
+ These are the various flags that can be passed to :meth:`mmap.mmap`. Note that some options might not be present on some systems.
+
+ .. versionchanged:: 3.10
+ Added MAP_POPULATE constant.
setint(dict, "MAP_ANON", MAP_ANONYMOUS);
setint(dict, "MAP_ANONYMOUS", MAP_ANONYMOUS);
#endif
+#ifdef MAP_POPULATE
+ setint(dict, "MAP_POPULATE", MAP_POPULATE);
+#endif
setint(dict, "PAGESIZE", (long)my_getpagesize());