bpo-37129: Add os.RWF_APPEND flag for os.pwritev() (GH-20336)

This commit is contained in:
YoSTEALTH 2020-05-27 15:32:22 -06:00 committed by GitHub
parent e4799b9594
commit 76ef255bde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 6 deletions

View file

@ -9778,6 +9778,7 @@ The flags argument contains a bitwise OR of zero or more of the following flags:
- RWF_DSYNC
- RWF_SYNC
- RWF_APPEND
Using non-zero flags requires Linux 4.7 or newer.
[clinic start generated code]*/
@ -9785,7 +9786,7 @@ Using non-zero flags requires Linux 4.7 or newer.
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;
@ -14509,6 +14510,9 @@ all_ins(PyObject *m)
#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