Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert mode_t constants to octal #3634

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions src/fuchsia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
18 changes: 9 additions & 9 deletions src/solid/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
46 changes: 23 additions & 23 deletions src/unix/aix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1594,29 +1594,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;
Expand Down
46 changes: 23 additions & 23 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3166,29 +3166,29 @@ pub const O_SYMLINK: ::c_int = 0x00200000;
pub const O_DSYNC: ::c_int = 0x00400000;
pub const O_CLOEXEC: ::c_int = 0x01000000;
pub const O_NOFOLLOW_ANY: ::c_int = 0x20000000;
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;
Expand Down
46 changes: 23 additions & 23 deletions src/unix/bsd/freebsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,29 +555,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;
Expand Down
46 changes: 23 additions & 23 deletions src/unix/bsd/netbsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,29 +168,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;
Expand Down
42 changes: 21 additions & 21 deletions src/unix/haiku/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading