From: Christian Heimes Date: Fri, 16 Aug 2013 12:35:09 +0000 (+0200) Subject: Issue #18673: Add O_TMPFILE to os module. O_TMPFILE requires Linux kernel X-Git-Tag: v3.4.0a2~216 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=177b3f9982732bfbe7051b9d761882a7a744ee66;p=python Issue #18673: Add O_TMPFILE to os module. O_TMPFILE requires Linux kernel 3.11 or newer. It's only defined on system with 3.11 uapi headers, too. --- diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 5d8ecfbee1..cfcb062d40 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -919,6 +919,7 @@ or `the MSDN `_ on Window O_NOFOLLOW O_NOATIME O_PATH + O_TMPFILE These constants are GNU extensions and not present if they are not defined by the C library. diff --git a/Misc/NEWS b/Misc/NEWS index 229a25900b..93b60b2c9a 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -28,6 +28,9 @@ Core and Builtins Library ------- +- Issue #18673: Add O_TMPFILE to os module. O_TMPFILE requires Linux kernel + 3.11 or newer. It's only defined on system with 3.11 uapi headers, too. + - Issue #18532: Change the builtin hash algorithms' names to lower case names as promised by hashlib's documentation. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index ccba5f9981..ab3e9f0b03 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -11245,6 +11245,9 @@ all_ins(PyObject *m) #ifdef O_TTY_INIT if (PyModule_AddIntMacro(m, O_TTY_INIT)) return -1; #endif +#ifdef O_TMPFILE + if (PyModule_AddIntMacro(m, O_TMPFILE)) return -1; +#endif #ifdef PRIO_PROCESS if (PyModule_AddIntMacro(m, PRIO_PROCESS)) return -1; #endif