From: Victor Stinner Date: Mon, 7 Jan 2013 23:52:40 +0000 (+0100) Subject: fcntl: add F_DUPFD_CLOEXEC constant, available on Linux 2.6.24+. X-Git-Tag: v3.4.0a1~1680 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2716d531a1e2553bc6df43852357053370ff8bb0;p=python fcntl: add F_DUPFD_CLOEXEC constant, available on Linux 2.6.24+. --- diff --git a/Misc/NEWS b/Misc/NEWS index d073441427..4da0b8c7ae 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -206,6 +206,8 @@ Core and Builtins Library ------- +- fcntl: add F_DUPFD_CLOEXEC constant, available on Linux 2.6.24+. + - Issue #15972: Fix error messages when os functions expecting a file name or file descriptor receive the incorrect type. diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c index 550902690c..bc2c181dce 100644 --- a/Modules/fcntlmodule.c +++ b/Modules/fcntlmodule.c @@ -461,6 +461,9 @@ all_ins(PyObject* d) #ifdef F_DUPFD if (ins(d, "F_DUPFD", (long)F_DUPFD)) return -1; #endif +#ifdef F_DUPFD_CLOEXEC + if (ins(d, "F_DUPFD_CLOEXEC", (long)F_DUPFD_CLOEXEC)) return -1; +#endif #ifdef F_GETFD if (ins(d, "F_GETFD", (long)F_GETFD)) return -1; #endif