Skip to content

Commit 4f47bd7

Browse files
committed
Add more sys/stat.h constants
1 parent d071956 commit 4f47bd7

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/unix/redox/mod.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,15 +398,30 @@ extern {
398398
oldset: *mut ::sigset_t) -> ::c_int;
399399
}
400400

401-
// stat.h
401+
// sys/stat.h
402+
pub const S_IFMT: ::c_int = 0o0_170_000;
402403
pub const S_IFDIR: ::c_int = 0o040_000;
403404
pub const S_IFCHR: ::c_int = 0o020_000;
404405
pub const S_IFBLK: ::c_int = 0o060_000;
405406
pub const S_IFREG: ::c_int = 0o100_000;
406407
pub const S_IFIFO: ::c_int = 0o010_000;
407408
pub const S_IFLNK: ::c_int = 0o120_000;
408409
pub const S_IFSOCK: ::c_int = 0o140_000;
409-
pub const S_IFMT: ::c_int = 0o0_170_000;
410+
pub const S_IRWXU: ::c_int = 0o0_700;
411+
pub const S_IRUSR: ::c_int = 0o0_400;
412+
pub const S_IWUSR: ::c_int = 0o0_200;
413+
pub const S_IXUSR: ::c_int = 0o0_100;
414+
pub const S_IRWXG: ::c_int = 0o0_070;
415+
pub const S_IRGRP: ::c_int = 0o0_040;
416+
pub const S_IWGRP: ::c_int = 0o0_020;
417+
pub const S_IXGRP: ::c_int = 0o0_010;
418+
pub const S_IRWXO: ::c_int = 0o0_007;
419+
pub const S_IROTH: ::c_int = 0o0_004;
420+
pub const S_IWOTH: ::c_int = 0o0_002;
421+
pub const S_IXOTH: ::c_int = 0o0_001;
422+
pub const S_ISUID: ::c_int = 0o4_000;
423+
pub const S_ISGID: ::c_int = 0o2_000;
424+
pub const S_ISVTX: ::c_int = 0o1_000;
410425

411426
// stdlib.h
412427
pub const EXIT_SUCCESS: ::c_int = 0;

0 commit comments

Comments
 (0)