https://github.com/python/cpython/commit/8e18a9dce2af361d9974812e6ffa22bf3970d057
commit: 8e18a9dce2af361d9974812e6ffa22bf3970d057
branch: main
author: RUANG (James Roy) <longjin...@outlook.com>
committer: serhiy-storchaka <storch...@gmail.com>
date: 2025-04-25T00:06:42+03:00
summary:

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

files:
A Misc/NEWS.d/next/Library/2024-11-29-13-06-52.gh-issue-127385.PErcyB.rst
M Doc/library/fcntl.rst
M Modules/fcntlmodule.c

diff --git a/Doc/library/fcntl.rst b/Doc/library/fcntl.rst
index a9fbab3d0bbf33..b4ea3e7e31bd8c 100644
--- a/Doc/library/fcntl.rst
+++ b/Doc/library/fcntl.rst
@@ -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:
 
 
diff --git 
a/Misc/NEWS.d/next/Library/2024-11-29-13-06-52.gh-issue-127385.PErcyB.rst 
b/Misc/NEWS.d/next/Library/2024-11-29-13-06-52.gh-issue-127385.PErcyB.rst
new file mode 100644
index 00000000000000..3770d586ba4620
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2024-11-29-13-06-52.gh-issue-127385.PErcyB.rst
@@ -0,0 +1 @@
+Add the ``F_DUPFD_QUERY`` constant to the :mod:`fcntl` module.
diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c
index 81a1e1c22c8a27..7e14e6bc3a525d 100644
--- a/Modules/fcntlmodule.c
+++ b/Modules/fcntlmodule.c
@@ -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;

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to