]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
misc: Add support for Linux uio.h RWF_NOAPPEND flag
authorStafford Horne <shorne@gmail.com>
Wed, 3 Apr 2024 05:40:37 +0000 (06:40 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Sat, 20 Jul 2024 17:30:25 +0000 (19:30 +0200)
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 <adhemerval.zanella@linaro.org>
(cherry picked from commit 3db9d208dd5f30b12900989c6d2214782b8e2011)

manual/llio.texi
misc/tst-preadvwritev2-common.c
sysdeps/unix/sysv/linux/bits/uio-ext.h

index e55b02d8bd839827a352c751f11ad18114c32ed3..85aa32b4f06ab6172f1c1d2d7077f6b52fd81deb 100644 (file)
@@ -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
index 40b527bdcbe045a523edf5fcc7076665a7687f62..ed3dc04eeb5101da0448332dd4c32c928a1344c9 100644 (file)
 #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
index 5b0dba08c556b72ffe150fd44a524b9351c1af57..e49b66facde8bce6d78548c4adb1666aef20cf61 100644 (file)
@@ -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