summaryrefslogtreecommitdiffstats
path: root/Doc/library/os.rst
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2019-05-29 19:57:07 (GMT)
committerChristian Heimes <christian@python.org>2019-05-29 19:57:03 (GMT)
commit43fdbd2729cb7cdbb5afb5d16352f6604859e564 (patch)
tree88cddedd14a456ffef515fa70718b1cb5ec33b31 /Doc/library/os.rst
parent0c2f9305640f7655ba0cd5f478948b2763b376b3 (diff)
downloadcpython-43fdbd2729cb7cdbb5afb5d16352f6604859e564.zip
cpython-43fdbd2729cb7cdbb5afb5d16352f6604859e564.tar.gz
cpython-43fdbd2729cb7cdbb5afb5d16352f6604859e564.tar.bz2
bpo-26836: Add os.memfd_create() (#13567)
* bpo-26836: Add os.memfd_create() * Use the glibc wrapper for memfd_create() Co-Authored-By: Christian Heimes <christian@python.org> * Fix deletions caused by autoreconf. * Use MFD_CLOEXEC as the default value for *flags*. * Add memset_s to configure.ac. * Revert memset_s changes. * Apply the requested changes. * Tweak the docs.
Diffstat (limited to 'Doc/library/os.rst')
-rw-r--r--Doc/library/os.rst38
1 files changed, 38 insertions, 0 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 6df2b49..b53fd71 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -2982,6 +2982,44 @@ features:
Added support for :class:`bytes` paths.
+.. function:: memfd_create(name[, flags=os.MFD_CLOEXEC])
+
+ Create an anonymous file and return a file descriptor that refers to it.
+ *flags* must be one of the ``os.MFD_*`` constants available on the system
+ (or a bitwise ORed combination of them). By default, the new file
+ descriptor is :ref:`non-inheritable <fd_inheritance>`.
+
+ .. availability:: Linux 3.17 or newer with glibc 2.27 or newer.
+
+ .. versionadded:: 3.8
+
+
+.. data:: MFD_CLOEXEC
+ MFD_ALLOW_SEALING
+ MFD_HUGETLB
+ MFD_HUGE_SHIFT
+ MFD_HUGE_MASK
+ MFD_HUGE_64KB
+ MFD_HUGE_512KB
+ MFD_HUGE_1MB
+ MFD_HUGE_2MB
+ MFD_HUGE_8MB
+ MFD_HUGE_16MB
+ MFD_HUGE_32MB
+ MFD_HUGE_256MB
+ MFD_HUGE_512MB
+ MFD_HUGE_1GB
+ MFD_HUGE_2GB
+ MFD_HUGE_16GB
+
+ These flags can be passed to :func:`memfd_create`.
+
+ .. availability:: Linux 3.17 or newer with glibc 2.27 or newer. The
+ ``MFD_HUGE*`` flags are only available since Linux 4.14.
+
+ .. versionadded:: 3.8
+
+
Linux extended attributes
~~~~~~~~~~~~~~~~~~~~~~~~~