Skip to content

gh-127385: Add F_DUPFD_QUERY to fcntl #127386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 24, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Doc/library/fcntl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ descriptor.
On macOS and NetBSD, the :mod:`!fcntl` module exposes the ``F_GETNOSIGPIPE``
and ``F_SETNOSIGPIPE`` constant.

.. versionchanged:: 3.14
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:


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add the ``F_DUPFD_QUERY`` macro constants to the :mod:`fcntl`.
3 changes: 3 additions & 0 deletions Modules/fcntlmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,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;
Expand Down
Loading