From e4424387a5d7f3c62cf44b9e9fe7b52a436836dd Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 26 Mar 2024 22:06:37 -0700 Subject: [PATCH] Convert mode_t constants to octal (backport ) (cherry picked from commit 3cc3f01204bb8969c309554616167aacc77cc2ca) --- src/fuchsia/mod.rs | 46 ++++++------- src/solid/mod.rs | 18 ++--- src/unix/aix/mod.rs | 46 ++++++------- src/unix/bsd/apple/mod.rs | 46 ++++++------- src/unix/bsd/freebsdlike/mod.rs | 46 ++++++------- src/unix/bsd/netbsdlike/mod.rs | 46 ++++++------- src/unix/haiku/mod.rs | 42 ++++++------ src/unix/hurd/mod.rs | 98 +++++++++++++-------------- src/unix/linux_like/emscripten/mod.rs | 6 +- src/unix/linux_like/linux/mod.rs | 6 +- src/unix/linux_like/mod.rs | 40 +++++------ src/unix/mod.rs | 6 +- src/unix/newlib/mod.rs | 42 ++++++------ src/unix/nto/mod.rs | 42 ++++++------ src/unix/redox/mod.rs | 40 +++++------ src/unix/solarish/mod.rs | 46 ++++++------- src/vxworks/mod.rs | 48 ++++++------- src/wasi/mod.rs | 42 ++++++------ src/windows/mod.rs | 14 ++-- 19 files changed, 360 insertions(+), 360 deletions(-) diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs index 9414d1674f26e..f3bba75e69b5f 100644 --- a/src/fuchsia/mod.rs +++ b/src/fuchsia/mod.rs @@ -1467,26 +1467,26 @@ pub const O_RDONLY: ::c_int = 0; pub const O_WRONLY: ::c_int = 1; pub const O_RDWR: ::c_int = 2; -pub const S_IFIFO: ::mode_t = 4096; -pub const S_IFCHR: ::mode_t = 8192; -pub const S_IFBLK: ::mode_t = 24576; -pub const S_IFDIR: ::mode_t = 16384; -pub const S_IFREG: ::mode_t = 32768; -pub const S_IFLNK: ::mode_t = 40960; -pub const S_IFSOCK: ::mode_t = 49152; -pub const S_IFMT: ::mode_t = 61440; -pub const S_IRWXU: ::mode_t = 448; -pub const S_IXUSR: ::mode_t = 64; -pub const S_IWUSR: ::mode_t = 128; -pub const S_IRUSR: ::mode_t = 256; -pub const S_IRWXG: ::mode_t = 56; -pub const S_IXGRP: ::mode_t = 8; -pub const S_IWGRP: ::mode_t = 16; -pub const S_IRGRP: ::mode_t = 32; -pub const S_IRWXO: ::mode_t = 7; -pub const S_IXOTH: ::mode_t = 1; -pub const S_IWOTH: ::mode_t = 2; -pub const S_IROTH: ::mode_t = 4; +pub const S_IFIFO: ::mode_t = 0o1_0000; +pub const S_IFCHR: ::mode_t = 0o2_0000; +pub const S_IFBLK: ::mode_t = 0o6_0000; +pub const S_IFDIR: ::mode_t = 0o4_0000; +pub const S_IFREG: ::mode_t = 0o10_0000; +pub const S_IFLNK: ::mode_t = 0o12_0000; +pub const S_IFSOCK: ::mode_t = 0o14_0000; +pub const S_IFMT: ::mode_t = 0o17_0000; +pub const S_IRWXU: ::mode_t = 0o0700; +pub const S_IXUSR: ::mode_t = 0o0100; +pub const S_IWUSR: ::mode_t = 0o0200; +pub const S_IRUSR: ::mode_t = 0o0400; +pub const S_IRWXG: ::mode_t = 0o0070; +pub const S_IXGRP: ::mode_t = 0o0010; +pub const S_IWGRP: ::mode_t = 0o0020; +pub const S_IRGRP: ::mode_t = 0o0040; +pub const S_IRWXO: ::mode_t = 0o0007; +pub const S_IXOTH: ::mode_t = 0o0001; +pub const S_IWOTH: ::mode_t = 0o0002; +pub const S_IROTH: ::mode_t = 0o0004; pub const F_OK: ::c_int = 0; pub const R_OK: ::c_int = 4; pub const W_OK: ::c_int = 2; @@ -2283,9 +2283,9 @@ pub const POSIX_MADV_RANDOM: ::c_int = 1; pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; pub const POSIX_MADV_WILLNEED: ::c_int = 3; -pub const S_IEXEC: mode_t = 64; -pub const S_IWRITE: mode_t = 128; -pub const S_IREAD: mode_t = 256; +pub const S_IEXEC: mode_t = 0o0100; +pub const S_IWRITE: mode_t = 0o0200; +pub const S_IREAD: mode_t = 0o0400; pub const F_LOCK: ::c_int = 1; pub const F_TEST: ::c_int = 3; diff --git a/src/solid/mod.rs b/src/solid/mod.rs index f0f2ae89bde90..2aca8d19abffd 100644 --- a/src/solid/mod.rs +++ b/src/solid/mod.rs @@ -209,15 +209,15 @@ pub const O_EXCL: c_int = 0x400; pub const O_TEXT: c_int = 0x100; pub const O_BINARY: c_int = 0x200; pub const O_TRUNC: c_int = 0x20; -pub const S_IEXEC: c_short = 0x0040; -pub const S_IWRITE: c_short = 0x0080; -pub const S_IREAD: c_short = 0x0100; -pub const S_IFCHR: c_short = 0x2000; -pub const S_IFDIR: c_short = 0x4000; -pub const S_IFMT: c_short = 0o160000; -pub const S_IFIFO: c_short = 0o0010000; -pub const S_IFBLK: c_short = 0o0060000; -pub const S_IFREG: c_short = 0o0100000; +pub const S_IEXEC: c_short = 0o0100; +pub const S_IWRITE: c_short = 0o0200; +pub const S_IREAD: c_short = 0o0400; +pub const S_IFCHR: c_short = 0o2_0000; +pub const S_IFDIR: c_short = 0o4_0000; +pub const S_IFMT: c_short = 0o16_0000; +pub const S_IFIFO: c_short = 0o1_0000; +pub const S_IFBLK: c_short = 0o6_0000; +pub const S_IFREG: c_short = 0o10_0000; pub const LC_ALL: c_int = 0; pub const LC_COLLATE: c_int = 1; diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs index c072ae55e5836..10e2974aa648e 100644 --- a/src/unix/aix/mod.rs +++ b/src/unix/aix/mod.rs @@ -1617,29 +1617,29 @@ pub const MADV_WILLNEED: ::c_int = 3; pub const MADV_DONTNEED: ::c_int = 4; // sys/mode.h -pub const S_IFMT: mode_t = 0o170000; -pub const S_IFREG: mode_t = 0o100000; -pub const S_IFDIR: mode_t = 0o40000; -pub const S_IFBLK: mode_t = 0o60000; -pub const S_IFCHR: mode_t = 0o20000; -pub const S_IFIFO: mode_t = 0o10000; -pub const S_IRWXU: mode_t = 0o700; -pub const S_IRUSR: mode_t = 0o400; -pub const S_IWUSR: mode_t = 0o200; -pub const S_IXUSR: mode_t = 0o100; -pub const S_IRWXG: mode_t = 0o70; -pub const S_IRGRP: mode_t = 0o40; -pub const S_IWGRP: mode_t = 0o20; -pub const S_IXGRP: mode_t = 0o10; -pub const S_IRWXO: mode_t = 7; -pub const S_IROTH: mode_t = 4; -pub const S_IWOTH: mode_t = 2; -pub const S_IXOTH: mode_t = 1; -pub const S_IFLNK: mode_t = 0o120000; -pub const S_IFSOCK: mode_t = 0o140000; -pub const S_IEXEC: mode_t = 0o100; -pub const S_IWRITE: mode_t = 0o200; -pub const S_IREAD: mode_t = 0o400; +pub const S_IFMT: mode_t = 0o17_0000; +pub const S_IFREG: mode_t = 0o10_0000; +pub const S_IFDIR: mode_t = 0o4_0000; +pub const S_IFBLK: mode_t = 0o6_0000; +pub const S_IFCHR: mode_t = 0o2_0000; +pub const S_IFIFO: mode_t = 0o1_0000; +pub const S_IRWXU: mode_t = 0o0700; +pub const S_IRUSR: mode_t = 0o0400; +pub const S_IWUSR: mode_t = 0o0200; +pub const S_IXUSR: mode_t = 0o0100; +pub const S_IRWXG: mode_t = 0o0070; +pub const S_IRGRP: mode_t = 0o0040; +pub const S_IWGRP: mode_t = 0o0020; +pub const S_IXGRP: mode_t = 0o0010; +pub const S_IRWXO: mode_t = 0o0007; +pub const S_IROTH: mode_t = 0o0004; +pub const S_IWOTH: mode_t = 0o0002; +pub const S_IXOTH: mode_t = 0o0001; +pub const S_IFLNK: mode_t = 0o12_0000; +pub const S_IFSOCK: mode_t = 0o14_0000; +pub const S_IEXEC: mode_t = 0o0100; +pub const S_IWRITE: mode_t = 0o0200; +pub const S_IREAD: mode_t = 0o0400; // sys/msg.h pub const MSG_NOERROR: ::c_int = 0o10000; diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 8f882f9b6954d..6769b700bc4fd 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -3272,29 +3272,29 @@ pub const O_CLOEXEC: ::c_int = 0x01000000; pub const O_NOFOLLOW_ANY: ::c_int = 0x20000000; pub const O_EXEC: ::c_int = 0x40000000; pub const O_SEARCH: ::c_int = O_EXEC | O_DIRECTORY; -pub const S_IFIFO: mode_t = 4096; -pub const S_IFCHR: mode_t = 8192; -pub const S_IFBLK: mode_t = 24576; -pub const S_IFDIR: mode_t = 16384; -pub const S_IFREG: mode_t = 32768; -pub const S_IFLNK: mode_t = 40960; -pub const S_IFSOCK: mode_t = 49152; -pub const S_IFMT: mode_t = 61440; -pub const S_IEXEC: mode_t = 64; -pub const S_IWRITE: mode_t = 128; -pub const S_IREAD: mode_t = 256; -pub const S_IRWXU: mode_t = 448; -pub const S_IXUSR: mode_t = 64; -pub const S_IWUSR: mode_t = 128; -pub const S_IRUSR: mode_t = 256; -pub const S_IRWXG: mode_t = 56; -pub const S_IXGRP: mode_t = 8; -pub const S_IWGRP: mode_t = 16; -pub const S_IRGRP: mode_t = 32; -pub const S_IRWXO: mode_t = 7; -pub const S_IXOTH: mode_t = 1; -pub const S_IWOTH: mode_t = 2; -pub const S_IROTH: mode_t = 4; +pub const S_IFIFO: mode_t = 0o1_0000; +pub const S_IFCHR: mode_t = 0o2_0000; +pub const S_IFBLK: mode_t = 0o6_0000; +pub const S_IFDIR: mode_t = 0o4_0000; +pub const S_IFREG: mode_t = 0o10_0000; +pub const S_IFLNK: mode_t = 0o12_0000; +pub const S_IFSOCK: mode_t = 0o14_0000; +pub const S_IFMT: mode_t = 0o17_0000; +pub const S_IEXEC: mode_t = 0o0100; +pub const S_IWRITE: mode_t = 0o0200; +pub const S_IREAD: mode_t = 0o0400; +pub const S_IRWXU: mode_t = 0o0700; +pub const S_IXUSR: mode_t = 0o0100; +pub const S_IWUSR: mode_t = 0o0200; +pub const S_IRUSR: mode_t = 0o0400; +pub const S_IRWXG: mode_t = 0o0070; +pub const S_IXGRP: mode_t = 0o0010; +pub const S_IWGRP: mode_t = 0o0020; +pub const S_IRGRP: mode_t = 0o0040; +pub const S_IRWXO: mode_t = 0o0007; +pub const S_IXOTH: mode_t = 0o0001; +pub const S_IWOTH: mode_t = 0o0002; +pub const S_IROTH: mode_t = 0o0004; pub const F_OK: ::c_int = 0; pub const R_OK: ::c_int = 4; pub const W_OK: ::c_int = 2; diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index 86ade55353560..6ef1a59429207 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -563,29 +563,29 @@ pub const TMP_MAX: ::c_uint = 308915776; pub const O_NOCTTY: ::c_int = 32768; pub const O_DIRECT: ::c_int = 0x00010000; -pub const S_IFIFO: mode_t = 4096; -pub const S_IFCHR: mode_t = 8192; -pub const S_IFBLK: mode_t = 24576; -pub const S_IFDIR: mode_t = 16384; -pub const S_IFREG: mode_t = 32768; -pub const S_IFLNK: mode_t = 40960; -pub const S_IFSOCK: mode_t = 49152; -pub const S_IFMT: mode_t = 61440; -pub const S_IEXEC: mode_t = 64; -pub const S_IWRITE: mode_t = 128; -pub const S_IREAD: mode_t = 256; -pub const S_IRWXU: mode_t = 448; -pub const S_IXUSR: mode_t = 64; -pub const S_IWUSR: mode_t = 128; -pub const S_IRUSR: mode_t = 256; -pub const S_IRWXG: mode_t = 56; -pub const S_IXGRP: mode_t = 8; -pub const S_IWGRP: mode_t = 16; -pub const S_IRGRP: mode_t = 32; -pub const S_IRWXO: mode_t = 7; -pub const S_IXOTH: mode_t = 1; -pub const S_IWOTH: mode_t = 2; -pub const S_IROTH: mode_t = 4; +pub const S_IFIFO: mode_t = 0o1_0000; +pub const S_IFCHR: mode_t = 0o2_0000; +pub const S_IFBLK: mode_t = 0o6_0000; +pub const S_IFDIR: mode_t = 0o4_0000; +pub const S_IFREG: mode_t = 0o10_0000; +pub const S_IFLNK: mode_t = 0o12_0000; +pub const S_IFSOCK: mode_t = 0o14_0000; +pub const S_IFMT: mode_t = 0o17_0000; +pub const S_IEXEC: mode_t = 0o0100; +pub const S_IWRITE: mode_t = 0o0200; +pub const S_IREAD: mode_t = 0o0400; +pub const S_IRWXU: mode_t = 0o0700; +pub const S_IXUSR: mode_t = 0o0100; +pub const S_IWUSR: mode_t = 0o0200; +pub const S_IRUSR: mode_t = 0o0400; +pub const S_IRWXG: mode_t = 0o0070; +pub const S_IXGRP: mode_t = 0o0010; +pub const S_IWGRP: mode_t = 0o0020; +pub const S_IRGRP: mode_t = 0o0040; +pub const S_IRWXO: mode_t = 0o0007; +pub const S_IXOTH: mode_t = 0o0001; +pub const S_IWOTH: mode_t = 0o0002; +pub const S_IROTH: mode_t = 0o0004; pub const F_OK: ::c_int = 0; pub const R_OK: ::c_int = 4; pub const W_OK: ::c_int = 2; diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs index dcd3582fd7bf8..2c0c8d540fed5 100644 --- a/src/unix/bsd/netbsdlike/mod.rs +++ b/src/unix/bsd/netbsdlike/mod.rs @@ -173,29 +173,29 @@ pub const FOPEN_MAX: ::c_uint = 20; pub const FILENAME_MAX: ::c_uint = 1024; pub const L_tmpnam: ::c_uint = 1024; pub const O_NOCTTY: ::c_int = 32768; -pub const S_IFIFO: mode_t = 4096; -pub const S_IFCHR: mode_t = 8192; -pub const S_IFBLK: mode_t = 24576; -pub const S_IFDIR: mode_t = 16384; -pub const S_IFREG: mode_t = 32768; -pub const S_IFLNK: mode_t = 40960; -pub const S_IFSOCK: mode_t = 49152; -pub const S_IFMT: mode_t = 61440; -pub const S_IEXEC: mode_t = 64; -pub const S_IWRITE: mode_t = 128; -pub const S_IREAD: mode_t = 256; -pub const S_IRWXU: mode_t = 448; -pub const S_IXUSR: mode_t = 64; -pub const S_IWUSR: mode_t = 128; -pub const S_IRUSR: mode_t = 256; -pub const S_IRWXG: mode_t = 56; -pub const S_IXGRP: mode_t = 8; -pub const S_IWGRP: mode_t = 16; -pub const S_IRGRP: mode_t = 32; -pub const S_IRWXO: mode_t = 7; -pub const S_IXOTH: mode_t = 1; -pub const S_IWOTH: mode_t = 2; -pub const S_IROTH: mode_t = 4; +pub const S_IFIFO: mode_t = 0o1_0000; +pub const S_IFCHR: mode_t = 0o2_0000; +pub const S_IFBLK: mode_t = 0o6_0000; +pub const S_IFDIR: mode_t = 0o4_0000; +pub const S_IFREG: mode_t = 0o10_0000; +pub const S_IFLNK: mode_t = 0o12_0000; +pub const S_IFSOCK: mode_t = 0o14_0000; +pub const S_IFMT: mode_t = 0o17_0000; +pub const S_IEXEC: mode_t = 0o0100; +pub const S_IWRITE: mode_t = 0o0200; +pub const S_IREAD: mode_t = 0o0400; +pub const S_IRWXU: mode_t = 0o0700; +pub const S_IXUSR: mode_t = 0o0100; +pub const S_IWUSR: mode_t = 0o0200; +pub const S_IRUSR: mode_t = 0o0400; +pub const S_IRWXG: mode_t = 0o0070; +pub const S_IXGRP: mode_t = 0o0010; +pub const S_IWGRP: mode_t = 0o0020; +pub const S_IRGRP: mode_t = 0o0040; +pub const S_IRWXO: mode_t = 0o0007; +pub const S_IXOTH: mode_t = 0o0001; +pub const S_IWOTH: mode_t = 0o0002; +pub const S_IROTH: mode_t = 0o0004; pub const F_OK: ::c_int = 0; pub const R_OK: ::c_int = 4; pub const W_OK: ::c_int = 2; diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index 31f9f69d5b168..6f76ab26befd6 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -771,27 +771,27 @@ pub const O_NOFOLLOW: ::c_int = 0x00080000; pub const O_NOCACHE: ::c_int = 0x00100000; pub const O_DIRECTORY: ::c_int = 0x00200000; -pub const S_IFIFO: ::mode_t = 4096; -pub const S_IFCHR: ::mode_t = 8192; -pub const S_IFBLK: ::mode_t = 24576; -pub const S_IFDIR: ::mode_t = 16384; -pub const S_IFREG: ::mode_t = 32768; -pub const S_IFLNK: ::mode_t = 40960; -pub const S_IFSOCK: ::mode_t = 49152; -pub const S_IFMT: ::mode_t = 61440; - -pub const S_IRWXU: ::mode_t = 0o00700; -pub const S_IRUSR: ::mode_t = 0o00400; -pub const S_IWUSR: ::mode_t = 0o00200; -pub const S_IXUSR: ::mode_t = 0o00100; -pub const S_IRWXG: ::mode_t = 0o00070; -pub const S_IRGRP: ::mode_t = 0o00040; -pub const S_IWGRP: ::mode_t = 0o00020; -pub const S_IXGRP: ::mode_t = 0o00010; -pub const S_IRWXO: ::mode_t = 0o00007; -pub const S_IROTH: ::mode_t = 0o00004; -pub const S_IWOTH: ::mode_t = 0o00002; -pub const S_IXOTH: ::mode_t = 0o00001; +pub const S_IFIFO: ::mode_t = 0o1_0000; +pub const S_IFCHR: ::mode_t = 0o2_0000; +pub const S_IFBLK: ::mode_t = 0o6_0000; +pub const S_IFDIR: ::mode_t = 0o4_0000; +pub const S_IFREG: ::mode_t = 0o10_0000; +pub const S_IFLNK: ::mode_t = 0o12_0000; +pub const S_IFSOCK: ::mode_t = 0o14_0000; +pub const S_IFMT: ::mode_t = 0o17_0000; + +pub const S_IRWXU: ::mode_t = 0o0700; +pub const S_IRUSR: ::mode_t = 0o0400; +pub const S_IWUSR: ::mode_t = 0o0200; +pub const S_IXUSR: ::mode_t = 0o0100; +pub const S_IRWXG: ::mode_t = 0o0070; +pub const S_IRGRP: ::mode_t = 0o0040; +pub const S_IWGRP: ::mode_t = 0o0020; +pub const S_IXGRP: ::mode_t = 0o0010; +pub const S_IRWXO: ::mode_t = 0o0007; +pub const S_IROTH: ::mode_t = 0o0004; +pub const S_IWOTH: ::mode_t = 0o0002; +pub const S_IXOTH: ::mode_t = 0o0001; pub const F_OK: ::c_int = 0; pub const R_OK: ::c_int = 4; diff --git a/src/unix/hurd/mod.rs b/src/unix/hurd/mod.rs index ec22469a31693..97c15fe6603a3 100644 --- a/src/unix/hurd/mod.rs +++ b/src/unix/hurd/mod.rs @@ -2121,29 +2121,29 @@ pub const MINSIGSTKSZ: usize = 8192; pub const SIGSTKSZ: usize = 40960; // sys/stat.h -pub const __S_IFMT: mode_t = 61440; -pub const __S_IFDIR: mode_t = 16384; -pub const __S_IFCHR: mode_t = 8192; -pub const __S_IFBLK: mode_t = 24576; -pub const __S_IFREG: mode_t = 32768; -pub const __S_IFLNK: mode_t = 40960; -pub const __S_IFSOCK: mode_t = 49152; -pub const __S_IFIFO: mode_t = 4096; -pub const __S_ISUID: mode_t = 2048; -pub const __S_ISGID: mode_t = 1024; -pub const __S_ISVTX: mode_t = 512; -pub const __S_IREAD: mode_t = 256; -pub const __S_IWRITE: mode_t = 128; -pub const __S_IEXEC: mode_t = 64; -pub const S_INOCACHE: mode_t = 65536; -pub const S_IUSEUNK: mode_t = 131072; -pub const S_IUNKNOWN: mode_t = 1835008; -pub const S_IUNKSHIFT: mode_t = 12; -pub const S_IPTRANS: mode_t = 2097152; -pub const S_IATRANS: mode_t = 4194304; -pub const S_IROOT: mode_t = 8388608; -pub const S_ITRANS: mode_t = 14680064; -pub const S_IMMAP0: mode_t = 16777216; +pub const __S_IFMT: mode_t = 0o17_0000; +pub const __S_IFDIR: mode_t = 0o4_0000; +pub const __S_IFCHR: mode_t = 0o2_0000; +pub const __S_IFBLK: mode_t = 0o6_0000; +pub const __S_IFREG: mode_t = 0o10_0000; +pub const __S_IFLNK: mode_t = 0o12_0000; +pub const __S_IFSOCK: mode_t = 0o14_0000; +pub const __S_IFIFO: mode_t = 0o1_0000; +pub const __S_ISUID: mode_t = 0o4000; +pub const __S_ISGID: mode_t = 0o2000; +pub const __S_ISVTX: mode_t = 0o1000; +pub const __S_IREAD: mode_t = 0o0400; +pub const __S_IWRITE: mode_t = 0o0200; +pub const __S_IEXEC: mode_t = 0o0100; +pub const S_INOCACHE: mode_t = 0o20_0000; +pub const S_IUSEUNK: mode_t = 0o40_0000; +pub const S_IUNKNOWN: mode_t = 0o700_0000; +pub const S_IUNKSHIFT: mode_t = 0o0014; +pub const S_IPTRANS: mode_t = 0o1000_0000; +pub const S_IATRANS: mode_t = 0o2000_0000; +pub const S_IROOT: mode_t = 0o4000_0000; +pub const S_ITRANS: mode_t = 0o7000_0000; +pub const S_IMMAP0: mode_t = 0o10000_0000; pub const CMASK: mode_t = 18; pub const UF_SETTABLE: ::c_uint = 65535; pub const UF_NODUMP: ::c_uint = 1; @@ -2159,32 +2159,32 @@ pub const SF_NOUNLINK: ::c_uint = 1048576; pub const SF_SNAPSHOT: ::c_uint = 2097152; pub const UTIME_NOW: ::c_long = -1; pub const UTIME_OMIT: ::c_long = -2; -pub const S_IFMT: ::mode_t = 61440; -pub const S_IFDIR: ::mode_t = 16384; -pub const S_IFCHR: ::mode_t = 8192; -pub const S_IFBLK: ::mode_t = 24576; -pub const S_IFREG: ::mode_t = 32768; -pub const S_IFIFO: ::mode_t = 4096; -pub const S_IFLNK: ::mode_t = 40960; -pub const S_IFSOCK: ::mode_t = 49152; -pub const S_ISUID: ::mode_t = 2048; -pub const S_ISGID: ::mode_t = 1024; -pub const S_ISVTX: ::mode_t = 512; -pub const S_IRUSR: ::mode_t = 256; -pub const S_IWUSR: ::mode_t = 128; -pub const S_IXUSR: ::mode_t = 64; -pub const S_IRWXU: ::mode_t = 448; -pub const S_IREAD: ::mode_t = 256; -pub const S_IWRITE: ::mode_t = 128; -pub const S_IEXEC: ::mode_t = 64; -pub const S_IRGRP: ::mode_t = 32; -pub const S_IWGRP: ::mode_t = 16; -pub const S_IXGRP: ::mode_t = 8; -pub const S_IRWXG: ::mode_t = 56; -pub const S_IROTH: ::mode_t = 4; -pub const S_IWOTH: ::mode_t = 2; -pub const S_IXOTH: ::mode_t = 1; -pub const S_IRWXO: ::mode_t = 7; +pub const S_IFMT: ::mode_t = 0o17_0000; +pub const S_IFDIR: ::mode_t = 0o4_0000; +pub const S_IFCHR: ::mode_t = 0o2_0000; +pub const S_IFBLK: ::mode_t = 0o6_0000; +pub const S_IFREG: ::mode_t = 0o10_0000; +pub const S_IFIFO: ::mode_t = 0o1_0000; +pub const S_IFLNK: ::mode_t = 0o12_0000; +pub const S_IFSOCK: ::mode_t = 0o14_0000; +pub const S_ISUID: ::mode_t = 0o4000; +pub const S_ISGID: ::mode_t = 0o2000; +pub const S_ISVTX: ::mode_t = 0o1000; +pub const S_IRUSR: ::mode_t = 0o0400; +pub const S_IWUSR: ::mode_t = 0o0200; +pub const S_IXUSR: ::mode_t = 0o0100; +pub const S_IRWXU: ::mode_t = 0o0700; +pub const S_IREAD: ::mode_t = 0o0400; +pub const S_IWRITE: ::mode_t = 0o0200; +pub const S_IEXEC: ::mode_t = 0o0100; +pub const S_IRGRP: ::mode_t = 0o0040; +pub const S_IWGRP: ::mode_t = 0o0020; +pub const S_IXGRP: ::mode_t = 0o0010; +pub const S_IRWXG: ::mode_t = 0o0070; +pub const S_IROTH: ::mode_t = 0o0004; +pub const S_IWOTH: ::mode_t = 0o0002; +pub const S_IXOTH: ::mode_t = 0o0001; +pub const S_IRWXO: ::mode_t = 0o0007; pub const ACCESSPERMS: ::mode_t = 511; pub const ALLPERMS: ::mode_t = 4095; pub const DEFFILEMODE: ::mode_t = 438; diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs index 2f515f390d8e2..393244d9996f2 100644 --- a/src/unix/linux_like/emscripten/mod.rs +++ b/src/unix/linux_like/emscripten/mod.rs @@ -777,9 +777,9 @@ pub const POSIX_MADV_WILLNEED: ::c_int = 3; pub const AT_EACCESS: ::c_int = 0x200; -pub const S_IEXEC: mode_t = 64; -pub const S_IWRITE: mode_t = 128; -pub const S_IREAD: mode_t = 256; +pub const S_IEXEC: mode_t = 0o0100; +pub const S_IWRITE: mode_t = 0o0200; +pub const S_IREAD: mode_t = 0o0400; pub const F_LOCK: ::c_int = 1; pub const F_TEST: ::c_int = 3; diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index f26af4c1fe16f..40d0cf0ab974f 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -2040,9 +2040,9 @@ pub const POSIX_MADV_WILLNEED: ::c_int = 3; pub const POSIX_SPAWN_USEVFORK: ::c_int = 64; pub const POSIX_SPAWN_SETSID: ::c_int = 128; -pub const S_IEXEC: mode_t = 64; -pub const S_IWRITE: mode_t = 128; -pub const S_IREAD: mode_t = 256; +pub const S_IEXEC: mode_t = 0o0100; +pub const S_IWRITE: mode_t = 0o0200; +pub const S_IREAD: mode_t = 0o0400; pub const F_LOCK: ::c_int = 1; pub const F_TEST: ::c_int = 3; diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index 749c8a16d0148..618980e53dd27 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -505,26 +505,26 @@ pub const O_RDWR: ::c_int = 2; pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC; -pub const S_IFIFO: ::mode_t = 4096; -pub const S_IFCHR: ::mode_t = 8192; -pub const S_IFBLK: ::mode_t = 24576; -pub const S_IFDIR: ::mode_t = 16384; -pub const S_IFREG: ::mode_t = 32768; -pub const S_IFLNK: ::mode_t = 40960; -pub const S_IFSOCK: ::mode_t = 49152; -pub const S_IFMT: ::mode_t = 61440; -pub const S_IRWXU: ::mode_t = 448; -pub const S_IXUSR: ::mode_t = 64; -pub const S_IWUSR: ::mode_t = 128; -pub const S_IRUSR: ::mode_t = 256; -pub const S_IRWXG: ::mode_t = 56; -pub const S_IXGRP: ::mode_t = 8; -pub const S_IWGRP: ::mode_t = 16; -pub const S_IRGRP: ::mode_t = 32; -pub const S_IRWXO: ::mode_t = 7; -pub const S_IXOTH: ::mode_t = 1; -pub const S_IWOTH: ::mode_t = 2; -pub const S_IROTH: ::mode_t = 4; +pub const S_IFIFO: ::mode_t = 0o1_0000; +pub const S_IFCHR: ::mode_t = 0o2_0000; +pub const S_IFBLK: ::mode_t = 0o6_0000; +pub const S_IFDIR: ::mode_t = 0o4_0000; +pub const S_IFREG: ::mode_t = 0o10_0000; +pub const S_IFLNK: ::mode_t = 0o12_0000; +pub const S_IFSOCK: ::mode_t = 0o14_0000; +pub const S_IFMT: ::mode_t = 0o17_0000; +pub const S_IRWXU: ::mode_t = 0o0700; +pub const S_IXUSR: ::mode_t = 0o0100; +pub const S_IWUSR: ::mode_t = 0o0200; +pub const S_IRUSR: ::mode_t = 0o0400; +pub const S_IRWXG: ::mode_t = 0o0070; +pub const S_IXGRP: ::mode_t = 0o0010; +pub const S_IWGRP: ::mode_t = 0o0020; +pub const S_IRGRP: ::mode_t = 0o0040; +pub const S_IRWXO: ::mode_t = 0o0007; +pub const S_IXOTH: ::mode_t = 0o0001; +pub const S_IWOTH: ::mode_t = 0o0002; +pub const S_IROTH: ::mode_t = 0o0004; pub const F_OK: ::c_int = 0; pub const R_OK: ::c_int = 4; pub const W_OK: ::c_int = 2; diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 12e20a46ff1c4..318db742bb951 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -235,9 +235,9 @@ cfg_if! { } pub const SIGIOT: ::c_int = 6; -pub const S_ISUID: ::mode_t = 0x800; -pub const S_ISGID: ::mode_t = 0x400; -pub const S_ISVTX: ::mode_t = 0x200; +pub const S_ISUID: ::mode_t = 0o4000; +pub const S_ISGID: ::mode_t = 0o2000; +pub const S_ISVTX: ::mode_t = 0o1000; cfg_if! { if #[cfg(not(any(target_os = "haiku", target_os = "illumos", diff --git a/src/unix/newlib/mod.rs b/src/unix/newlib/mod.rs index 9aee0e4ea0c3f..37cfb8ed3afb2 100644 --- a/src/unix/newlib/mod.rs +++ b/src/unix/newlib/mod.rs @@ -479,27 +479,27 @@ pub const FIOCLEX: ::c_ulong = 0x20006601; pub const FIONCLEX: ::c_ulong = 0x20006602; pub const S_BLKSIZE: ::mode_t = 1024; -pub const S_IREAD: ::mode_t = 256; -pub const S_IWRITE: ::mode_t = 128; -pub const S_IEXEC: ::mode_t = 64; -pub const S_ENFMT: ::mode_t = 1024; -pub const S_IFMT: ::mode_t = 61440; -pub const S_IFDIR: ::mode_t = 16384; -pub const S_IFCHR: ::mode_t = 8192; -pub const S_IFBLK: ::mode_t = 24576; -pub const S_IFREG: ::mode_t = 32768; -pub const S_IFLNK: ::mode_t = 40960; -pub const S_IFSOCK: ::mode_t = 49152; -pub const S_IFIFO: ::mode_t = 4096; -pub const S_IRUSR: ::mode_t = 256; -pub const S_IWUSR: ::mode_t = 128; -pub const S_IXUSR: ::mode_t = 64; -pub const S_IRGRP: ::mode_t = 32; -pub const S_IWGRP: ::mode_t = 16; -pub const S_IXGRP: ::mode_t = 8; -pub const S_IROTH: ::mode_t = 4; -pub const S_IWOTH: ::mode_t = 2; -pub const S_IXOTH: ::mode_t = 1; +pub const S_IREAD: ::mode_t = 0o0400; +pub const S_IWRITE: ::mode_t = 0o0200; +pub const S_IEXEC: ::mode_t = 0o0100; +pub const S_ENFMT: ::mode_t = 0o2000; +pub const S_IFMT: ::mode_t = 0o17_0000; +pub const S_IFDIR: ::mode_t = 0o4_0000; +pub const S_IFCHR: ::mode_t = 0o2_0000; +pub const S_IFBLK: ::mode_t = 0o6_0000; +pub const S_IFREG: ::mode_t = 0o10_0000; +pub const S_IFLNK: ::mode_t = 0o12_0000; +pub const S_IFSOCK: ::mode_t = 0o14_0000; +pub const S_IFIFO: ::mode_t = 0o1_0000; +pub const S_IRUSR: ::mode_t = 0o0400; +pub const S_IWUSR: ::mode_t = 0o0200; +pub const S_IXUSR: ::mode_t = 0o0100; +pub const S_IRGRP: ::mode_t = 0o0040; +pub const S_IWGRP: ::mode_t = 0o0020; +pub const S_IXGRP: ::mode_t = 0o0010; +pub const S_IROTH: ::mode_t = 0o0004; +pub const S_IWOTH: ::mode_t = 0o0002; +pub const S_IXOTH: ::mode_t = 0o0001; pub const SOL_TCP: ::c_int = 6; diff --git a/src/unix/nto/mod.rs b/src/unix/nto/mod.rs index 001b51a7da678..eff3f8003bb45 100644 --- a/src/unix/nto/mod.rs +++ b/src/unix/nto/mod.rs @@ -2037,27 +2037,27 @@ pub const S_IEXEC: mode_t = ::S_IXUSR; pub const S_IWRITE: mode_t = ::S_IWUSR; pub const S_IREAD: mode_t = ::S_IRUSR; -pub const S_IFIFO: ::mode_t = 0x1000; -pub const S_IFCHR: ::mode_t = 0x2000; -pub const S_IFDIR: ::mode_t = 0x4000; -pub const S_IFBLK: ::mode_t = 0x6000; -pub const S_IFREG: ::mode_t = 0x8000; -pub const S_IFLNK: ::mode_t = 0xA000; -pub const S_IFSOCK: ::mode_t = 0xC000; -pub const S_IFMT: ::mode_t = 0xF000; - -pub const S_IXOTH: ::mode_t = 0o000001; -pub const S_IWOTH: ::mode_t = 0o000002; -pub const S_IROTH: ::mode_t = 0o000004; -pub const S_IRWXO: ::mode_t = 0o000007; -pub const S_IXGRP: ::mode_t = 0o000010; -pub const S_IWGRP: ::mode_t = 0o000020; -pub const S_IRGRP: ::mode_t = 0o000040; -pub const S_IRWXG: ::mode_t = 0o000070; -pub const S_IXUSR: ::mode_t = 0o000100; -pub const S_IWUSR: ::mode_t = 0o000200; -pub const S_IRUSR: ::mode_t = 0o000400; -pub const S_IRWXU: ::mode_t = 0o000700; +pub const S_IFIFO: ::mode_t = 0o1_0000; +pub const S_IFCHR: ::mode_t = 0o2_0000; +pub const S_IFDIR: ::mode_t = 0o4_0000; +pub const S_IFBLK: ::mode_t = 0o6_0000; +pub const S_IFREG: ::mode_t = 0o10_0000; +pub const S_IFLNK: ::mode_t = 0o12_0000; +pub const S_IFSOCK: ::mode_t = 0o14_0000; +pub const S_IFMT: ::mode_t = 0o17_0000; + +pub const S_IXOTH: ::mode_t = 0o0001; +pub const S_IWOTH: ::mode_t = 0o0002; +pub const S_IROTH: ::mode_t = 0o0004; +pub const S_IRWXO: ::mode_t = 0o0007; +pub const S_IXGRP: ::mode_t = 0o0010; +pub const S_IWGRP: ::mode_t = 0o0020; +pub const S_IRGRP: ::mode_t = 0o0040; +pub const S_IRWXG: ::mode_t = 0o0070; +pub const S_IXUSR: ::mode_t = 0o0100; +pub const S_IWUSR: ::mode_t = 0o0200; +pub const S_IRUSR: ::mode_t = 0o0400; +pub const S_IRWXU: ::mode_t = 0o0700; pub const F_LOCK: ::c_int = 1; pub const F_TEST: ::c_int = 3; diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index ac092a372b576..39e7346b0cc33 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -695,26 +695,26 @@ pub const EPOLLONESHOT: ::c_int = 1 << 30; pub const EPOLLET: ::c_int = 1 << 31; // sys/stat.h -pub const S_IFMT: ::c_int = 0o0_170_000; -pub const S_IFDIR: ::c_int = 0o040_000; -pub const S_IFCHR: ::c_int = 0o020_000; -pub const S_IFBLK: ::c_int = 0o060_000; -pub const S_IFREG: ::c_int = 0o100_000; -pub const S_IFIFO: ::c_int = 0o010_000; -pub const S_IFLNK: ::c_int = 0o120_000; -pub const S_IFSOCK: ::c_int = 0o140_000; -pub const S_IRWXU: ::c_int = 0o0_700; -pub const S_IRUSR: ::c_int = 0o0_400; -pub const S_IWUSR: ::c_int = 0o0_200; -pub const S_IXUSR: ::c_int = 0o0_100; -pub const S_IRWXG: ::c_int = 0o0_070; -pub const S_IRGRP: ::c_int = 0o0_040; -pub const S_IWGRP: ::c_int = 0o0_020; -pub const S_IXGRP: ::c_int = 0o0_010; -pub const S_IRWXO: ::c_int = 0o0_007; -pub const S_IROTH: ::c_int = 0o0_004; -pub const S_IWOTH: ::c_int = 0o0_002; -pub const S_IXOTH: ::c_int = 0o0_001; +pub const S_IFMT: ::c_int = 0o17_0000; +pub const S_IFDIR: ::c_int = 0o4_0000; +pub const S_IFCHR: ::c_int = 0o2_0000; +pub const S_IFBLK: ::c_int = 0o6_0000; +pub const S_IFREG: ::c_int = 0o10_0000; +pub const S_IFIFO: ::c_int = 0o1_0000; +pub const S_IFLNK: ::c_int = 0o12_0000; +pub const S_IFSOCK: ::c_int = 0o14_0000; +pub const S_IRWXU: ::c_int = 0o0700; +pub const S_IRUSR: ::c_int = 0o0400; +pub const S_IWUSR: ::c_int = 0o0200; +pub const S_IXUSR: ::c_int = 0o0100; +pub const S_IRWXG: ::c_int = 0o0070; +pub const S_IRGRP: ::c_int = 0o0040; +pub const S_IWGRP: ::c_int = 0o0020; +pub const S_IXGRP: ::c_int = 0o0010; +pub const S_IRWXO: ::c_int = 0o0007; +pub const S_IROTH: ::c_int = 0o0004; +pub const S_IWOTH: ::c_int = 0o0002; +pub const S_IXOTH: ::c_int = 0o0001; // stdlib.h pub const EXIT_SUCCESS: ::c_int = 0; diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index 1cc6c429bc2d1..7aa6d5fda953a 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -1320,29 +1320,29 @@ pub const O_ACCMODE: ::c_int = 0x600003; pub const O_XATTR: ::c_int = 0x4000; pub const O_DIRECTORY: ::c_int = 0x1000000; pub const O_DIRECT: ::c_int = 0x2000000; -pub const S_IFIFO: mode_t = 4096; -pub const S_IFCHR: mode_t = 8192; -pub const S_IFBLK: mode_t = 24576; -pub const S_IFDIR: mode_t = 16384; -pub const S_IFREG: mode_t = 32768; -pub const S_IFLNK: mode_t = 40960; -pub const S_IFSOCK: mode_t = 49152; -pub const S_IFMT: mode_t = 61440; -pub const S_IEXEC: mode_t = 64; -pub const S_IWRITE: mode_t = 128; -pub const S_IREAD: mode_t = 256; -pub const S_IRWXU: mode_t = 448; -pub const S_IXUSR: mode_t = 64; -pub const S_IWUSR: mode_t = 128; -pub const S_IRUSR: mode_t = 256; -pub const S_IRWXG: mode_t = 56; -pub const S_IXGRP: mode_t = 8; -pub const S_IWGRP: mode_t = 16; -pub const S_IRGRP: mode_t = 32; -pub const S_IRWXO: mode_t = 7; -pub const S_IXOTH: mode_t = 1; -pub const S_IWOTH: mode_t = 2; -pub const S_IROTH: mode_t = 4; +pub const S_IFIFO: mode_t = 0o1_0000; +pub const S_IFCHR: mode_t = 0o2_0000; +pub const S_IFBLK: mode_t = 0o6_0000; +pub const S_IFDIR: mode_t = 0o4_0000; +pub const S_IFREG: mode_t = 0o10_0000; +pub const S_IFLNK: mode_t = 0o12_0000; +pub const S_IFSOCK: mode_t = 0o14_0000; +pub const S_IFMT: mode_t = 0o17_0000; +pub const S_IEXEC: mode_t = 0o0100; +pub const S_IWRITE: mode_t = 0o0200; +pub const S_IREAD: mode_t = 0o0400; +pub const S_IRWXU: mode_t = 0o0700; +pub const S_IXUSR: mode_t = 0o0100; +pub const S_IWUSR: mode_t = 0o0200; +pub const S_IRUSR: mode_t = 0o0400; +pub const S_IRWXG: mode_t = 0o0070; +pub const S_IXGRP: mode_t = 0o0010; +pub const S_IWGRP: mode_t = 0o0020; +pub const S_IRGRP: mode_t = 0o0040; +pub const S_IRWXO: mode_t = 0o0007; +pub const S_IXOTH: mode_t = 0o0001; +pub const S_IWOTH: mode_t = 0o0002; +pub const S_IROTH: mode_t = 0o0004; pub const F_OK: ::c_int = 0; pub const R_OK: ::c_int = 4; pub const W_OK: ::c_int = 2; diff --git a/src/vxworks/mod.rs b/src/vxworks/mod.rs index f7adb5d682e5e..daf3b013b48b3 100644 --- a/src/vxworks/mod.rs +++ b/src/vxworks/mod.rs @@ -783,31 +783,31 @@ pub const IPV6_ADD_MEMBERSHIP: ::c_int = 12; pub const IPV6_DROP_MEMBERSHIP: ::c_int = 13; // STAT Stuff -pub const S_IFMT: ::c_int = 0xf000; -pub const S_IFIFO: ::c_int = 0x1000; -pub const S_IFCHR: ::c_int = 0x2000; -pub const S_IFDIR: ::c_int = 0x4000; -pub const S_IFBLK: ::c_int = 0x6000; -pub const S_IFREG: ::c_int = 0x8000; -pub const S_IFLNK: ::c_int = 0xa000; -pub const S_IFSHM: ::c_int = 0xb000; -pub const S_IFSOCK: ::c_int = 0xc000; -pub const S_ISUID: ::c_int = 0x0800; -pub const S_ISGID: ::c_int = 0x0400; -pub const S_ISTXT: ::c_int = 0x0200; +pub const S_IFMT: ::c_int = 0o17_0000; +pub const S_IFIFO: ::c_int = 0o1_0000; +pub const S_IFCHR: ::c_int = 0o2_0000; +pub const S_IFDIR: ::c_int = 0o4_0000; +pub const S_IFBLK: ::c_int = 0o6_0000; +pub const S_IFREG: ::c_int = 0o10_0000; +pub const S_IFLNK: ::c_int = 0o12_0000; +pub const S_IFSHM: ::c_int = 0o13_0000; +pub const S_IFSOCK: ::c_int = 0o14_0000; +pub const S_ISUID: ::c_int = 0o4000; +pub const S_ISGID: ::c_int = 0o2000; +pub const S_ISTXT: ::c_int = 0o1000; pub const S_ISVTX: ::c_int = 0o1000; -pub const S_IRUSR: ::c_int = 0x0100; -pub const S_IWUSR: ::c_int = 0x0080; -pub const S_IXUSR: ::c_int = 0x0040; -pub const S_IRWXU: ::c_int = 0x01c0; -pub const S_IRGRP: ::c_int = 0x0020; -pub const S_IWGRP: ::c_int = 0x0010; -pub const S_IXGRP: ::c_int = 0x0008; -pub const S_IRWXG: ::c_int = 0x0038; -pub const S_IROTH: ::c_int = 0x0004; -pub const S_IWOTH: ::c_int = 0x0002; -pub const S_IXOTH: ::c_int = 0x0001; -pub const S_IRWXO: ::c_int = 0x0007; +pub const S_IRUSR: ::c_int = 0o0400; +pub const S_IWUSR: ::c_int = 0o0200; +pub const S_IXUSR: ::c_int = 0o0100; +pub const S_IRWXU: ::c_int = 0o0700; +pub const S_IRGRP: ::c_int = 0o0040; +pub const S_IWGRP: ::c_int = 0o0020; +pub const S_IXGRP: ::c_int = 0o0010; +pub const S_IRWXG: ::c_int = 0o0070; +pub const S_IROTH: ::c_int = 0o0004; +pub const S_IWOTH: ::c_int = 0o0002; +pub const S_IXOTH: ::c_int = 0o0001; +pub const S_IRWXO: ::c_int = 0o0007; // socket.h pub const SOL_SOCKET: ::c_int = 0xffff; diff --git a/src/wasi/mod.rs b/src/wasi/mod.rs index d47d4076cc720..743f607379768 100644 --- a/src/wasi/mod.rs +++ b/src/wasi/mod.rs @@ -246,28 +246,28 @@ pub const AT_REMOVEDIR: c_int = 0x4; pub const UTIME_OMIT: c_long = 0xfffffffe; pub const UTIME_NOW: c_long = 0xffffffff; pub const S_IFIFO: mode_t = 0o1_0000; -pub const S_IFCHR: mode_t = 8192; -pub const S_IFBLK: mode_t = 24576; -pub const S_IFDIR: mode_t = 16384; -pub const S_IFREG: mode_t = 32768; -pub const S_IFLNK: mode_t = 40960; -pub const S_IFSOCK: mode_t = 49152; +pub const S_IFCHR: mode_t = 0o2_0000; +pub const S_IFBLK: mode_t = 0o6_0000; +pub const S_IFDIR: mode_t = 0o4_0000; +pub const S_IFREG: mode_t = 0o10_0000; +pub const S_IFLNK: mode_t = 0o12_0000; +pub const S_IFSOCK: mode_t = 0o14_0000; pub const S_IFMT: mode_t = 0o17_0000; -pub const S_IRWXO: mode_t = 0x7; -pub const S_IXOTH: mode_t = 0x1; -pub const S_IWOTH: mode_t = 0x2; -pub const S_IROTH: mode_t = 0x4; -pub const S_IRWXG: mode_t = 0x38; -pub const S_IXGRP: mode_t = 0x8; -pub const S_IWGRP: mode_t = 0x10; -pub const S_IRGRP: mode_t = 0x20; -pub const S_IRWXU: mode_t = 0x1c0; -pub const S_IXUSR: mode_t = 0x40; -pub const S_IWUSR: mode_t = 0x80; -pub const S_IRUSR: mode_t = 0x100; -pub const S_ISVTX: mode_t = 0x200; -pub const S_ISGID: mode_t = 0x400; -pub const S_ISUID: mode_t = 0x800; +pub const S_IRWXO: mode_t = 0o0007; +pub const S_IXOTH: mode_t = 0o0001; +pub const S_IWOTH: mode_t = 0o0002; +pub const S_IROTH: mode_t = 0o0004; +pub const S_IRWXG: mode_t = 0o0070; +pub const S_IXGRP: mode_t = 0o0010; +pub const S_IWGRP: mode_t = 0o0020; +pub const S_IRGRP: mode_t = 0o0040; +pub const S_IRWXU: mode_t = 0o0700; +pub const S_IXUSR: mode_t = 0o0100; +pub const S_IWUSR: mode_t = 0o0200; +pub const S_IRUSR: mode_t = 0o0400; +pub const S_ISVTX: mode_t = 0o1000; +pub const S_ISGID: mode_t = 0o2000; +pub const S_ISUID: mode_t = 0o4000; pub const DT_UNKNOWN: u8 = 0; pub const DT_BLK: u8 = 1; pub const DT_CHR: u8 = 2; diff --git a/src/windows/mod.rs b/src/windows/mod.rs index 196f1f2e4b743..63536a809a421 100644 --- a/src/windows/mod.rs +++ b/src/windows/mod.rs @@ -140,13 +140,13 @@ pub const _O_OBTAIN_DIR: ::c_int = 0x2000; pub const O_SEQUENTIAL: ::c_int = 0x0020; pub const O_RANDOM: ::c_int = 0x0010; -pub const S_IFCHR: ::c_int = 8192; -pub const S_IFDIR: ::c_int = 16384; -pub const S_IFREG: ::c_int = 32768; -pub const S_IFMT: ::c_int = 61440; -pub const S_IEXEC: ::c_int = 64; -pub const S_IWRITE: ::c_int = 128; -pub const S_IREAD: ::c_int = 256; +pub const S_IFCHR: ::c_int = 0o2_0000; +pub const S_IFDIR: ::c_int = 0o4_0000; +pub const S_IFREG: ::c_int = 0o10_0000; +pub const S_IFMT: ::c_int = 0o17_0000; +pub const S_IEXEC: ::c_int = 0o0100; +pub const S_IWRITE: ::c_int = 0o0200; +pub const S_IREAD: ::c_int = 0o0400; pub const LC_ALL: ::c_int = 0; pub const LC_COLLATE: ::c_int = 1;