]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-127385: Add F_DUPFD_QUERY to fcntl (GH-127386)
authorRUANG (James Roy) <longjinyii@outlook.com>
Thu, 24 Apr 2025 21:06:42 +0000 (05:06 +0800)
committerGitHub <noreply@github.com>
Thu, 24 Apr 2025 21:06:42 +0000 (00:06 +0300)
Doc/library/fcntl.rst
Misc/NEWS.d/next/Library/2024-11-29-13-06-52.gh-issue-127385.PErcyB.rst [new file with mode: 0644]
Modules/fcntlmodule.c

index a9fbab3d0bbf33c0b423232dd03d5b839199ca5b..b4ea3e7e31bd8c499689cd2767737708ad0866b3 100644 (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:
 
 
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 (file)
index 0000000..3770d58
--- /dev/null
@@ -0,0 +1 @@
+Add the ``F_DUPFD_QUERY`` constant to the :mod:`fcntl` module.
index 81a1e1c22c8a27a044cff3286f284a367cf4b56c..7e14e6bc3a525d73e8b1ad734e2f2ff66471fec3 100644 (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;