Skip to content

Commit 8e18a9d

Browse files
authored
gh-127385: Add F_DUPFD_QUERY to fcntl (GH-127386)
1 parent eef49c3 commit 8e18a9d

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

Doc/library/fcntl.rst

+4
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ descriptor.
7979
On macOS and NetBSD, the :mod:`!fcntl` module exposes the ``F_GETNOSIGPIPE``
8080
and ``F_SETNOSIGPIPE`` constant.
8181

82+
.. versionchanged:: next
83+
On Linux >= 6.1, the :mod:`!fcntl` module exposes the ``F_DUPFD_QUERY``
84+
to query a file descriptor pointing to the same file.
85+
8286
The module defines the following functions:
8387

8488

Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add the ``F_DUPFD_QUERY`` constant to the :mod:`fcntl` module.

Modules/fcntlmodule.c

+3
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,9 @@ all_ins(PyObject* m)
559559
#ifdef F_NOTIFY
560560
if (PyModule_AddIntMacro(m, F_NOTIFY)) return -1;
561561
#endif
562+
#ifdef F_DUPFD_QUERY
563+
if (PyModule_AddIntMacro(m, F_DUPFD_QUERY)) return -1;
564+
#endif
562565
/* Old BSD flock(). */
563566
#ifdef F_EXLCK
564567
if (PyModule_AddIntMacro(m, F_EXLCK)) return -1;

0 commit comments

Comments
 (0)