Skip to content

Commit 3db74e3

Browse files
the8472tgross35
authored andcommitted
linux: add new flags for pwritev2/preadv2
(backport <#4452>) (cherry picked from commit 6e7549d)
1 parent e3c6d0d commit 3db74e3

File tree

6 files changed

+27
-15
lines changed

6 files changed

+27
-15
lines changed

libc-test/build.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4542,6 +4542,15 @@ fn test_linux(target: &str) {
45424542
// kernel 6.2 minimum
45434543
"TUN_F_USO4" | "TUN_F_USO6" | "IFF_NO_CARRIER" => true,
45444544

4545+
// kernel 6.9 minimum
4546+
"RWF_NOAPPEND" => true,
4547+
4548+
// kernel 6.11 minimum
4549+
"RWF_ATOMIC" => true,
4550+
4551+
// kernel 6.14 minimum
4552+
"RWF_DONTCACHE" => true,
4553+
45454554
// FIXME(linux): Requires more recent kernel headers
45464555
| "IFLA_PARENT_DEV_NAME" // linux v5.13+
45474556
| "IFLA_PARENT_DEV_BUS_NAME" // linux v5.13+

libc-test/semver/linux-gnu.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,11 @@ RTM_NEWCACHEREPORT
389389
RTM_NEWSTATS
390390
RUN_LVL
391391
RWF_APPEND
392+
RWF_ATOMIC
393+
RWF_DONTCACHE
392394
RWF_DSYNC
393395
RWF_HIPRI
396+
RWF_NOAPPEND
394397
RWF_NOWAIT
395398
RWF_SYNC
396399
SECURITYFS_MAGIC

libc-test/semver/linux-musl.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ PR_SET_VMA
3232
PR_SET_VMA_ANON_NAME
3333
RUN_LVL
3434
RWF_APPEND
35+
RWF_ATOMIC
36+
RWF_DONTCACHE
3537
RWF_DSYNC
3638
RWF_HIPRI
39+
RWF_NOAPPEND
3740
RWF_NOWAIT
3841
RWF_SYNC
3942
USER_PROCESS

src/unix/linux_like/linux/gnu/mod.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -942,15 +942,6 @@ pub const PTRACE_SYSCALL_INFO_SECCOMP: crate::__u8 = 3;
942942
pub const PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG: crate::__u8 = 0x4210;
943943
pub const PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG: crate::__u8 = 0x4211;
944944

945-
// linux/fs.h
946-
947-
// Flags for preadv2/pwritev2
948-
pub const RWF_HIPRI: c_int = 0x00000001;
949-
pub const RWF_DSYNC: c_int = 0x00000002;
950-
pub const RWF_SYNC: c_int = 0x00000004;
951-
pub const RWF_NOWAIT: c_int = 0x00000008;
952-
pub const RWF_APPEND: c_int = 0x00000010;
953-
954945
// linux/rtnetlink.h
955946
pub const TCA_PAD: c_ushort = 9;
956947
pub const TCA_DUMP_INVISIBLE: c_ushort = 10;

src/unix/linux_like/linux/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2897,6 +2897,18 @@ pub const IFA_F_NOPREFIXROUTE: u32 = 0x200;
28972897
pub const IFA_F_MCAUTOJOIN: u32 = 0x400;
28982898
pub const IFA_F_STABLE_PRIVACY: u32 = 0x800;
28992899

2900+
// linux/fs.h
2901+
2902+
// Flags for preadv2/pwritev2
2903+
pub const RWF_HIPRI: c_int = 0x00000001;
2904+
pub const RWF_DSYNC: c_int = 0x00000002;
2905+
pub const RWF_SYNC: c_int = 0x00000004;
2906+
pub const RWF_NOWAIT: c_int = 0x00000008;
2907+
pub const RWF_APPEND: c_int = 0x00000010;
2908+
pub const RWF_NOAPPEND: c_int = 0x00000020;
2909+
pub const RWF_ATOMIC: c_int = 0x00000040;
2910+
pub const RWF_DONTCACHE: c_int = 0x00000080;
2911+
29002912
// linux/if_link.h
29012913
pub const IFLA_UNSPEC: c_ushort = 0;
29022914
pub const IFLA_ADDRESS: c_ushort = 1;

src/unix/linux_like/linux/musl/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -747,12 +747,6 @@ pub const PTRACE_PEEKSIGINFO: c_int = 0x4209;
747747
pub const PTRACE_GETSIGMASK: c_uint = 0x420a;
748748
pub const PTRACE_SETSIGMASK: c_uint = 0x420b;
749749

750-
pub const RWF_HIPRI: c_int = 0x00000001;
751-
pub const RWF_DSYNC: c_int = 0x00000002;
752-
pub const RWF_SYNC: c_int = 0x00000004;
753-
pub const RWF_NOWAIT: c_int = 0x00000008;
754-
pub const RWF_APPEND: c_int = 0x00000010;
755-
756750
pub const AF_IB: c_int = 27;
757751
pub const AF_MPLS: c_int = 28;
758752
pub const AF_NFC: c_int = 39;

0 commit comments

Comments
 (0)