From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id 99CF7385E827; Wed, 29 May 2024 12:20:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99CF7385E827 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1716985222; bh=+WuR92WMZR0YiIE6Lg0zW2YvkmsNoCsKitihsBJAAOw=; h=From:To:Subject:Date:From; b=DWPszVtvot6EUhHvslnEeaAOiTC6Cpb3nQldlfCUgf4+PhJfnWPs/EEnL0JGO0F9R PYTz+zIsFSCxPYCUhYQXZzFNjlDHoq6eZw2rC/b1tQE60mwVwbVn1AO4KOqg9Oy/1E q1X+eV0MtLu0wwMaw4kZwqb4kGJFbewyU22kVsIw= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc/release/2.39/master] misc: Add support for Linux uio.h RWF_NOAPPEND flag X-Act-Checkin: glibc X-Git-Author: Stafford Horne X-Git-Refname: refs/heads/release/2.39/master X-Git-Oldrev: c9d8534406ab69b9bc1fd3fdfb9e88c9580d3f24 X-Git-Newrev: 70f560fc22212f733647c9121c26bbb2307f2e10 Message-Id: <20240529122022.99CF7385E827@sourceware.org> Date: Wed, 29 May 2024 12:20:22 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=70f560fc22212f733647c9121c26bbb2307f2e10 commit 70f560fc22212f733647c9121c26bbb2307f2e10 Author: Stafford Horne Date: Wed Apr 3 06:40:37 2024 +0100 misc: Add support for Linux uio.h RWF_NOAPPEND flag In Linux 6.9 a new flag is added to allow for Per-io operations to disable append mode even if a file was opened with the flag O_APPEND. This is done with the new RWF_NOAPPEND flag. This caused two test failures as these tests expected the flag 0x00000020 to be unused. Adding the flag definition now fixes these tests on Linux 6.9 (v6.9-rc1). FAIL: misc/tst-preadvwritev2 FAIL: misc/tst-preadvwritev64v2 This patch adds the flag, adjusts the test and adds details to documentation. Link: https://lore.kernel.org/all/20200831153207.GO3265@brightrain.aerifal.cx/ Reviewed-by: Adhemerval Zanella (cherry picked from commit 3db9d208dd5f30b12900989c6d2214782b8e2011) Diff: --- manual/llio.texi | 4 ++++ misc/tst-preadvwritev2-common.c | 5 ++++- sysdeps/unix/sysv/linux/bits/uio-ext.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/manual/llio.texi b/manual/llio.texi index 0b61d491f5..fae49d1433 100644 --- a/manual/llio.texi +++ b/manual/llio.texi @@ -1339,6 +1339,10 @@ will fail and set @code{errno} to @code{EAGAIN} if the operation would block. @item RWF_APPEND Per-IO synchronization as if the file was opened with @code{O_APPEND} flag. + +@item RWF_NOAPPEND +This flag allows an offset to be honored, even if the file was opened with +@code{O_APPEND} flag. @end vtable When the source file is compiled with @code{_FILE_OFFSET_BITS == 64} the diff --git a/misc/tst-preadvwritev2-common.c b/misc/tst-preadvwritev2-common.c index b5f19f002c..8e04ff7282 100644 --- a/misc/tst-preadvwritev2-common.c +++ b/misc/tst-preadvwritev2-common.c @@ -34,8 +34,11 @@ #ifndef RWF_APPEND # define RWF_APPEND 0 #endif +#ifndef RWF_NOAPPEND +# define RWF_NOAPPEND 0 +#endif #define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT \ - | RWF_APPEND) + | RWF_APPEND | RWF_NOAPPEND) /* Generic uio_lim.h does not define IOV_MAX. */ #ifndef IOV_MAX diff --git a/sysdeps/unix/sysv/linux/bits/uio-ext.h b/sysdeps/unix/sysv/linux/bits/uio-ext.h index 7854cccef3..ead7a09156 100644 --- a/sysdeps/unix/sysv/linux/bits/uio-ext.h +++ b/sysdeps/unix/sysv/linux/bits/uio-ext.h @@ -47,6 +47,7 @@ extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec, #define RWF_SYNC 0x00000004 /* per-IO O_SYNC. */ #define RWF_NOWAIT 0x00000008 /* per-IO nonblocking mode. */ #define RWF_APPEND 0x00000010 /* per-IO O_APPEND. */ +#define RWF_NOAPPEND 0x00000020 /* per-IO negation of O_APPEND */ __END_DECLS