Skip to content

Commit fbaeb28

Browse files
blurb-it[bot]devnexen
authored andcommitted
πŸ“œπŸ€– Added by blurb_it.
1 parent c4b1775 commit fbaeb28

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

β€ŽDoc/library/fcntl.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ descriptor.
4444
``F_SETPIPE_SZ`` constants, which allow to check and modify a pipe's size
4545
respectively.
4646

47+
.. versionchanged:: 3.11
48+
On FreeBSD, the fcntl module exposes the ``F_DUP2FD`` and ``F_DUP2FD_CLOEXEC``
49+
constants, which allow to duplicate a file descriptor, the latter setting
50+
``FD_CLOEXEC`` flag in addition.
51+
4752
The module defines the following functions:
4853

4954

β€ŽDoc/whatsnew/3.11.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,14 @@ unicodedata
329329
* The Unicode database has been updated to version 14.0.0. (:issue:`45190`).
330330

331331

332+
fcntl
333+
-----
334+
335+
* On FreeBSD, the `F_DUP2FD` and `F_DUP2FD_CLOEXEC` flags respectively
336+
are supported, the former equals to ``dup2`` usage while the latter set
337+
the ``FD_CLOEXEC`` flag in addition.
338+
339+
332340
Optimizations
333341
=============
334342

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Adding `F_DUP2FD` and `F_DUP2FD_CLOEXEC` constants from FreeBSD into the fcntl module.

β€ŽModules/fcntlmodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,9 @@ all_ins(PyObject* m)
582582
#endif
583583

584584
/* FreeBSD specifics */
585+
#ifdef F_DUP2FD
586+
if (PyModule_AddIntMacro(m, F_DUP2FD)) return -1;
587+
#endif
585588
#ifdef F_DUP2FD_CLOEXEC
586589
if (PyModule_AddIntMacro(m, F_DUP2FD_CLOEXEC)) return -1;
587590
#endif

0 commit comments

Comments
Β (0)