mirror of https://github.com/python/cpython
bpo-46016: fcntl module add FreeBSD's F_DUP2FD_CLOEXEC flag support (GH-29993)
This commit is contained in:
parent
2109f7880b
commit
267539bff7
|
@ -44,6 +44,11 @@ descriptor.
|
||||||
``F_SETPIPE_SZ`` constants, which allow to check and modify a pipe's size
|
``F_SETPIPE_SZ`` constants, which allow to check and modify a pipe's size
|
||||||
respectively.
|
respectively.
|
||||||
|
|
||||||
|
.. versionchanged:: 3.11
|
||||||
|
On FreeBSD, the fcntl module exposes the ``F_DUP2FD`` and ``F_DUP2FD_CLOEXEC``
|
||||||
|
constants, which allow to duplicate a file descriptor, the latter setting
|
||||||
|
``FD_CLOEXEC`` flag in addition.
|
||||||
|
|
||||||
The module defines the following functions:
|
The module defines the following functions:
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -329,6 +329,14 @@ unicodedata
|
||||||
* The Unicode database has been updated to version 14.0.0. (:issue:`45190`).
|
* The Unicode database has been updated to version 14.0.0. (:issue:`45190`).
|
||||||
|
|
||||||
|
|
||||||
|
fcntl
|
||||||
|
-----
|
||||||
|
|
||||||
|
* On FreeBSD, the `F_DUP2FD` and `F_DUP2FD_CLOEXEC` flags respectively
|
||||||
|
are supported, the former equals to ``dup2`` usage while the latter set
|
||||||
|
the ``FD_CLOEXEC`` flag in addition.
|
||||||
|
|
||||||
|
|
||||||
Optimizations
|
Optimizations
|
||||||
=============
|
=============
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Adding `F_DUP2FD` and `F_DUP2FD_CLOEXEC` constants from FreeBSD into the fcntl module.
|
|
@ -581,6 +581,14 @@ all_ins(PyObject* m)
|
||||||
if (PyModule_AddIntMacro(m, F_NOCACHE)) return -1;
|
if (PyModule_AddIntMacro(m, F_NOCACHE)) return -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* FreeBSD specifics */
|
||||||
|
#ifdef F_DUP2FD
|
||||||
|
if (PyModule_AddIntMacro(m, F_DUP2FD)) return -1;
|
||||||
|
#endif
|
||||||
|
#ifdef F_DUP2FD_CLOEXEC
|
||||||
|
if (PyModule_AddIntMacro(m, F_DUP2FD_CLOEXEC)) return -1;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* For F_{GET|SET}FL */
|
/* For F_{GET|SET}FL */
|
||||||
#ifdef FD_CLOEXEC
|
#ifdef FD_CLOEXEC
|
||||||
if (PyModule_AddIntMacro(m, FD_CLOEXEC)) return -1;
|
if (PyModule_AddIntMacro(m, FD_CLOEXEC)) return -1;
|
||||||
|
|
Loading…
Reference in New Issue