From 138202dae5b11fc37aaeefe4c4b5bc5cb9c2b8ff Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sat, 22 Oct 2022 09:22:05 -0600 Subject: [PATCH 1/3] Add more MNT_ flags on {Dragonfly,Net,Open}BSD --- src/unix/bsd/freebsdlike/dragonfly/mod.rs | 10 ++++++++++ src/unix/bsd/freebsdlike/freebsd/mod.rs | 1 - src/unix/bsd/freebsdlike/mod.rs | 1 + src/unix/bsd/netbsdlike/mod.rs | 6 ++++++ src/unix/bsd/netbsdlike/netbsd/mod.rs | 17 +++++++++++++++++ src/unix/bsd/netbsdlike/openbsd/mod.rs | 20 ++++++++++++++++++++ 6 files changed, 54 insertions(+), 1 deletion(-) diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 418ac3dc802c2..96818616b2c6f 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -1409,6 +1409,16 @@ pub const MSG_FBLOCKING: ::c_int = 0x00010000; pub const MSG_FNONBLOCKING: ::c_int = 0x00020000; pub const MSG_FMASK: ::c_int = 0xFFFF0000; +// sys/mount.h +pub const MNT_NODEV: ::c_int = 0x00000010; +pub const MNT_AUTOMOUNTED: ::c_int = 0x00000020; +pub const MNT_TRIM: ::c_int = 0x01000000; +pub const MNT_LOCAL: ::c_int = 0x00001000; +pub const MNT_QUOTA: ::c_int = 0x00002000; +pub const MNT_ROOTFS: ::c_int = 0x00004000; +pub const MNT_USER: ::c_int = 0x00008000; +pub const MNT_IGNORE: ::c_int = 0x00800000; + // utmpx entry types pub const EMPTY: ::c_short = 0; pub const RUN_LVL: ::c_short = 1; diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 08fd5a52df26b..f34b24c579a45 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -2280,7 +2280,6 @@ pub const MNT_MULTILABEL: ::c_int = 0x04000000; pub const MNT_NFS4ACLS: ::c_int = 0x00000010; pub const MNT_SNAPSHOT: ::c_int = 0x01000000; pub const MNT_UNION: ::c_int = 0x00000020; -pub const MNT_EXPUBLIC: ::c_int = 0x20000000; pub const MNT_NONBUSY: ::c_int = 0x04000000; pub const SCM_CREDS2: ::c_int = 0x08; diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index db21597d98168..9aefb36e4eb3e 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -630,6 +630,7 @@ pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; pub const MCL_CURRENT: ::c_int = 0x0001; pub const MCL_FUTURE: ::c_int = 0x0002; +pub const MNT_EXPUBLIC: ::c_int = 0x20000000; pub const MNT_NOATIME: ::c_int = 0x10000000; pub const MNT_NOCLUSTERR: ::c_int = 0x40000000; pub const MNT_NOCLUSTERW: ::c_int = 0x80000000; diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs index a7f35ef859730..3d5ba5e8855b0 100644 --- a/src/unix/bsd/netbsdlike/mod.rs +++ b/src/unix/bsd/netbsdlike/mod.rs @@ -419,6 +419,12 @@ pub const MADV_WILLNEED: ::c_int = 3; pub const MADV_DONTNEED: ::c_int = 4; pub const MADV_FREE: ::c_int = 6; +// sys/fstypes.h in NetBSD, or sys/mount.h in OpenBSD +pub const MNT_NODEV: ::c_int = 0x00000010; +pub const MNT_LOCAL: ::c_int = 0x00001000; +pub const MNT_QUOTA: ::c_int = 0x00002000; + + pub const AF_UNSPEC: ::c_int = 0; pub const AF_LOCAL: ::c_int = 1; pub const AF_UNIX: ::c_int = AF_LOCAL; diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index bfe2de0839d77..c512e729dcaed 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -1785,6 +1785,23 @@ pub const BIOCSDLT: ::c_ulong = 0x80044278; pub const BIOCGSEESENT: ::c_ulong = 0x40044276; pub const BIOCSSEESENT: ::c_ulong = 0x80044277; +// +pub const MNT_UNION: ::c_int = 0x00000020; +pub const MNT_NOCOREDUMP: ::c_int = 0x00008000; +pub const MNT_RELATIME: ::c_int = 0x00020000; +pub const MNT_IGNORE: ::c_int = 0x00100000; +pub const MNT_NFS4ACLS: ::c_int = 0x00200000; +pub const MNT_DISCARD: ::c_int = 0x00800000; +pub const MNT_EXTATTR: ::c_int = 0x01000000; +pub const MNT_LOG: ::c_int = 0x02000000; +pub const MNT_NOATIME: ::c_int = 0x04000000; +pub const MNT_AUTOMOUNTED: ::c_int = 0x10000000; +pub const MNT_SYMPERM: ::c_int = 0x20000000; +pub const MNT_NODEVMTIME: ::c_int = 0x40000000; +pub const MNT_SOFTDEP: ::c_int = 0x80000000; +pub const MNT_POSIX1EACLS: ::c_int = 0x00000800; +pub const MNT_ACLS: ::c_int = MNT_POSIX1EACLS; + // pub const NTP_API: ::c_int = 4; pub const MAXPHASE: ::c_long = 500000000; diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index f63ad9e638600..89fe7a9c89c52 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -1639,6 +1639,26 @@ pub const SF_ARCHIVED: ::c_uint = 0x00010000; pub const SF_IMMUTABLE: ::c_uint = 0x00020000; pub const SF_APPEND: ::c_uint = 0x00040000; +// sys/mount.h +pub const MNT_NOPERM: ::c_int = 0x00000020; +pub const MNT_WXALLOWED: ::c_int = 0x00000800; +pub const MNT_EXRDONLY: ::c_int = 0x00000080; +pub const MNT_EXPORTED: ::c_int = 0x00000100; +pub const MNT_DEFEXPORTED: ::c_int = 0x00000200; +pub const MNT_EXPORTANON: ::c_int = 0x00000400; +pub const MNT_ROOTFS: ::c_int = 0x00004000; +pub const MNT_NOATIME: ::c_int = 0x00008000; +pub const MNT_UPDATE: ::c_int = 0x00010000; +pub const MNT_DELEXPORT: ::c_int = 0x00020000; +pub const MNT_RELOAD: ::c_int = 0x00040000; +pub const MNT_FORCE: ::c_int = 0x00080000; +pub const MNT_STALLED: ::c_int = 0x00100000; +pub const MNT_SWAPPABLE: ::c_int = 0x00200000; +pub const MNT_WANTRDWR: ::c_int = 0x02000000; +pub const MNT_SOFTDEP: ::c_int = 0x04000000; +pub const MNT_DOOMED: ::c_int = 0x08000000; + +// For use with vfs_fsync and getfsstat pub const MNT_WAIT: ::c_int = 1; pub const MNT_NOWAIT: ::c_int = 2; pub const MNT_LAZY: ::c_int = 3; From cfa31165a90e171c316b0566b28ad850734bb842 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sat, 22 Oct 2022 10:23:26 -0600 Subject: [PATCH 2/3] Style fixes, and filter out duplicate definitions --- src/unix/bsd/netbsdlike/mod.rs | 1 - src/unix/bsd/netbsdlike/netbsd/mod.rs | 2 +- src/unix/bsd/netbsdlike/openbsd/mod.rs | 6 +----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs index 3d5ba5e8855b0..6c2096b1d9acf 100644 --- a/src/unix/bsd/netbsdlike/mod.rs +++ b/src/unix/bsd/netbsdlike/mod.rs @@ -424,7 +424,6 @@ pub const MNT_NODEV: ::c_int = 0x00000010; pub const MNT_LOCAL: ::c_int = 0x00001000; pub const MNT_QUOTA: ::c_int = 0x00002000; - pub const AF_UNSPEC: ::c_int = 0; pub const AF_LOCAL: ::c_int = 1; pub const AF_UNIX: ::c_int = AF_LOCAL; diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index c512e729dcaed..4b201e3400665 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -1793,7 +1793,7 @@ pub const MNT_IGNORE: ::c_int = 0x00100000; pub const MNT_NFS4ACLS: ::c_int = 0x00200000; pub const MNT_DISCARD: ::c_int = 0x00800000; pub const MNT_EXTATTR: ::c_int = 0x01000000; -pub const MNT_LOG: ::c_int = 0x02000000; +pub const MNT_LOG: ::c_int = 0x02000000; pub const MNT_NOATIME: ::c_int = 0x04000000; pub const MNT_AUTOMOUNTED: ::c_int = 0x10000000; pub const MNT_SYMPERM: ::c_int = 0x20000000; diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index 89fe7a9c89c52..3c966990a50cd 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -1643,19 +1643,15 @@ pub const SF_APPEND: ::c_uint = 0x00040000; pub const MNT_NOPERM: ::c_int = 0x00000020; pub const MNT_WXALLOWED: ::c_int = 0x00000800; pub const MNT_EXRDONLY: ::c_int = 0x00000080; -pub const MNT_EXPORTED: ::c_int = 0x00000100; pub const MNT_DEFEXPORTED: ::c_int = 0x00000200; pub const MNT_EXPORTANON: ::c_int = 0x00000400; pub const MNT_ROOTFS: ::c_int = 0x00004000; pub const MNT_NOATIME: ::c_int = 0x00008000; -pub const MNT_UPDATE: ::c_int = 0x00010000; pub const MNT_DELEXPORT: ::c_int = 0x00020000; -pub const MNT_RELOAD: ::c_int = 0x00040000; -pub const MNT_FORCE: ::c_int = 0x00080000; pub const MNT_STALLED: ::c_int = 0x00100000; pub const MNT_SWAPPABLE: ::c_int = 0x00200000; pub const MNT_WANTRDWR: ::c_int = 0x02000000; -pub const MNT_SOFTDEP: ::c_int = 0x04000000; +pub const MNT_SOFTDEP: ::c_int = 0x04000000; pub const MNT_DOOMED: ::c_int = 0x08000000; // For use with vfs_fsync and getfsstat From 8acaac5ddf6523a058bfac4858622b453a7cb908 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sat, 22 Oct 2022 19:54:28 -0600 Subject: [PATCH 3/3] Add new definitions to libc-test/semver --- libc-test/semver/dragonfly.txt | 11 ++++++++++- libc-test/semver/netbsd.txt | 18 ++++++++++++++++++ libc-test/semver/openbsd.txt | 16 ++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt index e27f0f6fda319..fa472ce662747 100644 --- a/libc-test/semver/dragonfly.txt +++ b/libc-test/semver/dragonfly.txt @@ -622,7 +622,16 @@ MINCORE_REFERENCED MINCORE_REFERENCED_OTHER MINCORE_SUPER MINSEC +MNT_AUTOMOUNTED +MNT_EXPUBLIC MNT_FORCE +MNT_IGNORE +MNT_LOCAL +MNT_NODEV +MNT_QUOTA +MNT_ROOTFS +MNT_TRIM +MNT_USER MOD_CLKA MOD_CLKB MOD_ESTERROR @@ -1536,4 +1545,4 @@ vmspace wait4 waitid xucred -eaccess \ No newline at end of file +eaccess diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt index 8e178c57a6781..f14f2eae45775 100644 --- a/libc-test/semver/netbsd.txt +++ b/libc-test/semver/netbsd.txt @@ -645,7 +645,25 @@ MCL_CURRENT MCL_FUTURE MDMBUF MINSEC +MNT_ACLS +MNT_AUTOMOUNTED +MNT_DISCARD +MNT_EXTATTR MNT_FORCE +MNT_IGNORE +MNT_LOCAL +MNT_LOG +MNT_NFS4ACLS +MNT_NOATIME +MNT_NOCOREDUMP +MNT_NODEV +MNT_NODEVMTIME +MNT_POSIX1EACLS +MNT_QUOTA +MNT_RELATIME +MNT_SOFTDEP +MNT_SYMPERM +MNT_UNION MOD_CLKA MOD_CLKB MOD_ESTERROR diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt index bdfd1b7744eae..0ae23f549bd26 100644 --- a/libc-test/semver/openbsd.txt +++ b/libc-test/semver/openbsd.txt @@ -484,7 +484,23 @@ MCL_CURRENT MCL_FUTURE MDMBUF MINSIGSTKSZ +MNT_DEFEXPORTED +MNT_DELEXPORT +MNT_DOOMED +MNT_EXPORTANON +MNT_EXRDONLY MNT_FORCE +MNT_LOCAL +MNT_NOATIME +MNT_NODEV +MNT_NOPERM +MNT_QUOTA +MNT_ROOTFS +MNT_SOFTDEP +MNT_STALLED +MNT_SWAPPABLE +MNT_WANTRDWR +MNT_WXALLOWED MON_1 MON_10 MON_11