Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 11 additions & 0 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,7 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo

- :data:`RWF_HIPRI`
- :data:`RWF_NOWAIT`
- :data:`RWF_DONTCACHE`

Return the total number of bytes actually read which can be less than the
total capacity of all the objects.
Expand Down Expand Up @@ -1546,6 +1547,15 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
.. versionadded:: 3.7


.. data:: RWF_DONTCACHE

Use uncached buffered IO.

.. availability:: Linux >= 6.14

.. versionadded:: next


.. function:: ptsname(fd, /)

Return the name of the slave pseudo-terminal device associated with the
Expand Down Expand Up @@ -1587,6 +1597,7 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
- :data:`RWF_DSYNC`
- :data:`RWF_SYNC`
- :data:`RWF_APPEND`
- :data:`RWF_DONTCACHE`

Return the total number of bytes actually written.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add :data:`os.RWF_DONTCACHE` constant for Linux 6.14+.
4 changes: 3 additions & 1 deletion Modules/clinic/posixmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -11756,14 +11756,15 @@ The flags argument contains a bitwise OR of zero or more of the following flags:

- RWF_HIPRI
- RWF_NOWAIT
- RWF_DONTCACHE

Using non-zero flags requires Linux 4.6 or newer.
[clinic start generated code]*/

static Py_ssize_t
os_preadv_impl(PyObject *module, int fd, PyObject *buffers, Py_off_t offset,
int flags)
/*[clinic end generated code: output=26fc9c6e58e7ada5 input=c1f876866fcd9d41]*/
/*[clinic end generated code: output=26fc9c6e58e7ada5 input=34fb3b9ca06f7ba7]*/
{
Py_ssize_t cnt, n;
int async_err = 0;
Expand Down Expand Up @@ -12413,14 +12414,15 @@ The flags argument contains a bitwise OR of zero or more of the following flags:
- RWF_DSYNC
- RWF_SYNC
- RWF_APPEND
- RWF_DONTCACHE

Using non-zero flags requires Linux 4.7 or newer.
[clinic start generated code]*/

static Py_ssize_t
os_pwritev_impl(PyObject *module, int fd, PyObject *buffers, Py_off_t offset,
int flags)
/*[clinic end generated code: output=e3dd3e9d11a6a5c7 input=99d8a21493ff76ca]*/
/*[clinic end generated code: output=e3dd3e9d11a6a5c7 input=664a67626d485665]*/
{
Py_ssize_t cnt;
Py_ssize_t result;
Expand Down Expand Up @@ -17646,6 +17648,9 @@ all_ins(PyObject *m)
#ifdef RWF_NOWAIT
if (PyModule_AddIntConstant(m, "RWF_NOWAIT", RWF_NOWAIT)) return -1;
#endif
#ifdef RWF_DONTCACHE
if (PyModule_AddIntConstant(m, "RWF_DONTCACHE", RWF_DONTCACHE)) return -1;
#endif
#ifdef RWF_APPEND
if (PyModule_AddIntConstant(m, "RWF_APPEND", RWF_APPEND)) return -1;
#endif
Expand Down
Loading