From 4ff4acec366598484abe322b30fd02023c073102 Mon Sep 17 00:00:00 2001 From: Kamal Marhubi Date: Mon, 14 Mar 2016 17:00:38 -0400 Subject: [PATCH 1/2] linux: Comment distinction between msync and mount MS_ flags They have different types and should be visually separated for ease of reading. --- src/unix/notbsd/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs index d5958121a1357..3283c3da85735 100644 --- a/src/unix/notbsd/mod.rs +++ b/src/unix/notbsd/mod.rs @@ -244,9 +244,12 @@ 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; +// MS_ flags for msync(2) pub const MS_ASYNC: ::c_int = 0x0001; pub const MS_INVALIDATE: ::c_int = 0x0002; pub const MS_SYNC: ::c_int = 0x0004; + +// MS_ flags for mount(2) pub const MS_RDONLY: ::c_ulong = 0x01; pub const MS_NOSUID: ::c_ulong = 0x02; pub const MS_NODEV: ::c_ulong = 0x04; From 10bfe0765147d62d730905115b02a6b32cea7266 Mon Sep 17 00:00:00 2001 From: Kamal Marhubi Date: Mon, 14 Mar 2016 17:29:54 -0400 Subject: [PATCH 2/2] linux: Move some MS_ flags for mount(2) up These flags are available on Android. --- src/unix/notbsd/linux/mod.rs | 5 ----- src/unix/notbsd/mod.rs | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index 82645ba0c3132..ea0b462fa9bf6 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -361,11 +361,6 @@ pub const SHM_UNLOCK: ::c_int = 12; pub const SHM_HUGETLB: ::c_int = 0o4000; pub const SHM_NORESERVE: ::c_int = 0o10000; -pub const MS_RELATIME: ::c_ulong = 0x200000; -pub const MS_KERNMOUNT: ::c_ulong = 0x400000; -pub const MS_I_VERSION: ::c_ulong = 0x800000; -pub const MS_STRICTATIME: ::c_ulong = 0x01000000; - pub const EPOLLRDHUP: ::c_int = 0x2000; pub const EPOLLONESHOT: ::c_int = 0x40000000; diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs index 3283c3da85735..826e57536fe1b 100644 --- a/src/unix/notbsd/mod.rs +++ b/src/unix/notbsd/mod.rs @@ -269,6 +269,10 @@ pub const MS_UNBINDABLE: ::c_ulong = 0x020000; pub const MS_PRIVATE: ::c_ulong = 0x040000; pub const MS_SLAVE: ::c_ulong = 0x080000; pub const MS_SHARED: ::c_ulong = 0x100000; +pub const MS_RELATIME: ::c_ulong = 0x200000; +pub const MS_KERNMOUNT: ::c_ulong = 0x400000; +pub const MS_I_VERSION: ::c_ulong = 0x800000; +pub const MS_STRICTATIME: ::c_ulong = 0x1000000; pub const MS_ACTIVE: ::c_ulong = 0x40000000; pub const MS_NOUSER: ::c_ulong = 0x80000000; pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000;