gh-127385: Add F_DUPFD_QUERY to fcntl (GH-127386)

This commit is contained in:
RUANG (James Roy) 2025-04-25 05:06:42 +08:00 committed by GitHub
parent eef49c3595
commit 8e18a9dce2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 0 deletions

View File

@ -79,6 +79,10 @@ descriptor.
On macOS and NetBSD, the :mod:`!fcntl` module exposes the ``F_GETNOSIGPIPE``
and ``F_SETNOSIGPIPE`` constant.
.. versionchanged:: next
On Linux >= 6.1, the :mod:`!fcntl` module exposes the ``F_DUPFD_QUERY``
to query a file descriptor pointing to the same file.
The module defines the following functions:

View File

@ -0,0 +1 @@
Add the ``F_DUPFD_QUERY`` constant to the :mod:`fcntl` module.

View File

@ -559,6 +559,9 @@ all_ins(PyObject* m)
#ifdef F_NOTIFY
if (PyModule_AddIntMacro(m, F_NOTIFY)) return -1;
#endif
#ifdef F_DUPFD_QUERY
if (PyModule_AddIntMacro(m, F_DUPFD_QUERY)) return -1;
#endif
/* Old BSD flock(). */
#ifdef F_EXLCK
if (PyModule_AddIntMacro(m, F_EXLCK)) return -1;