[Python-checkins] bpo-46222: posixmodule sendfile FreeBSD's constants updates. (GH-30327)

asvetlov webhook-mailer at python.org
Mon Jan 3 08:01:10 EST 2022


https://github.com/python/cpython/commit/c960b191b8999a9455bb4b2c50dc224d06fee80c
commit: c960b191b8999a9455bb4b2c50dc224d06fee80c
branch: main
author: David CARLIER <devnexen at gmail.com>
committer: asvetlov <andrew.svetlov at gmail.com>
date: 2022-01-03T15:01:04+02:00
summary:

bpo-46222: posixmodule sendfile FreeBSD's constants updates. (GH-30327)

* posixodule sendfile FreeBSD's constants updates.

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>

files:
A Misc/NEWS.d/next/Library/2022-01-01-17-34-32.bpo-46222.s2fzZU.rst
M Doc/library/os.rst
M Modules/posixmodule.c

diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 8e11c693c7c2e..3e8fc54485e20 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -1429,6 +1429,15 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
 
    .. versionadded:: 3.3
 
+.. data:: SF_NOCACHE
+
+   Parameter to the :func:`sendfile` function, if the implementation supports
+   it. The data won't be cached in the virtual memory and will be freed afterwards.
+
+   .. availability:: Unix.
+
+   .. versionadded:: 3.11
+
 
 .. function:: splice(src, dst, count, offset_src=None, offset_dst=None)
 
diff --git a/Misc/NEWS.d/next/Library/2022-01-01-17-34-32.bpo-46222.s2fzZU.rst b/Misc/NEWS.d/next/Library/2022-01-01-17-34-32.bpo-46222.s2fzZU.rst
new file mode 100644
index 0000000000000..1fe28792529d0
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-01-01-17-34-32.bpo-46222.s2fzZU.rst
@@ -0,0 +1 @@
+Adding ``SF_NOCACHE`` sendfile constant for FreeBSD for the posixmodule.
\ No newline at end of file
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index b3a5757a8221d..21adf806a4e85 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -15170,12 +15170,16 @@ all_ins(PyObject *m)
 #ifdef SF_NODISKIO
     if (PyModule_AddIntMacro(m, SF_NODISKIO)) return -1;
 #endif
+    /* is obsolete since the 11.x release */
 #ifdef SF_MNOWAIT
     if (PyModule_AddIntMacro(m, SF_MNOWAIT)) return -1;
 #endif
 #ifdef SF_SYNC
     if (PyModule_AddIntMacro(m, SF_SYNC)) return -1;
 #endif
+#ifdef SF_NOCACHE
+    if (PyModule_AddIntMacro(m, SF_NOCACHE)) return -1;
+#endif
 
     /* constants for posix_fadvise */
 #ifdef POSIX_FADV_NORMAL



More information about the Python-checkins mailing list