- :data:`RWF_DSYNC`
- :data:`RWF_SYNC`
+ - :data:`RWF_APPEND`
Return the total number of bytes actually written.
.. data:: RWF_DSYNC
- Provide a per-write equivalent of the :data:`O_DSYNC` ``open(2)`` flag. This
- flag effect applies only to the data range written by the system call.
+ Provide a per-write equivalent of the :data:`O_DSYNC` :func:`os.open` flag.
+ This flag effect applies only to the data range written by the system call.
.. availability:: Linux 4.7 and newer.
.. data:: RWF_SYNC
- Provide a per-write equivalent of the :data:`O_SYNC` ``open(2)`` flag. This
- flag effect applies only to the data range written by the system call.
+ Provide a per-write equivalent of the :data:`O_SYNC` :func:`os.open` flag.
+ This flag effect applies only to the data range written by the system call.
.. availability:: Linux 4.7 and newer.
.. versionadded:: 3.7
+.. data:: RWF_APPEND
+
+ Provide a per-write equivalent of the :data:`O_APPEND` :func:`os.open`
+ flag. This flag is meaningful only for :func:`os.pwritev`, and its
+ effect applies only to the data range written by the system call. The
+ *offset* argument does not affect the write operation; the data is always
+ appended to the end of the file. However, if the *offset* argument is
+ ``-1``, the current file *offset* is updated.
+
+ .. availability:: Linux 4.16 and newer.
+
+ .. versionadded:: 3.10
+
+
.. function:: read(fd, n)
Read at most *n* bytes from file descriptor *fd*.
"\n"
"- RWF_DSYNC\n"
"- RWF_SYNC\n"
+"- RWF_APPEND\n"
"\n"
"Using non-zero flags requires Linux 4.7 or newer.");
#ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#define OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */
-/*[clinic end generated code: output=b97bbc8cb5078540 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=9623b9e6f3809842 input=a9049054013a1b77]*/
- RWF_DSYNC
- RWF_SYNC
+- RWF_APPEND
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=803dc5ddbf0cfd3b]*/
+/*[clinic end generated code: output=e3dd3e9d11a6a5c7 input=35358c327e1a2a8e]*/
{
Py_ssize_t cnt;
Py_ssize_t result;
#ifdef RWF_NOWAIT
if (PyModule_AddIntConstant(m, "RWF_NOWAIT", RWF_NOWAIT)) return -1;
#endif
+#ifdef RWF_APPEND
+ if (PyModule_AddIntConstant(m, "RWF_APPEND", RWF_APPEND)) return -1;
+#endif
/* constants for posix_spawn */
#ifdef HAVE_POSIX_SPAWN