Skip to content

Commit 10af28f

Browse files
committed
Auto merge of rust-lang#715 - goyox86:add-missing-constants-redox, r=alexcrichton
Add some permission and misc (mostly 'mode_t' related) constants to Redox. Hi! While porting some software ((exa)[https://github.com/ogham/exa])to Redox I found these missing constants. Cheers! //cc @ids1024 @jackpot51
2 parents 2a5b50b + dcb0f86 commit 10af28f

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/redox.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,37 @@ pub const STDIN_FILENO: ::c_int = 0;
5252
pub const STDOUT_FILENO: ::c_int = 1;
5353
pub const STDERR_FILENO: ::c_int = 2;
5454

55+
pub const EXIT_FAILURE: ::c_int = 1;
56+
pub const EXIT_SUCCESS: ::c_int = 0;
57+
58+
pub const S_ISUID: ::c_int = 0x800;
59+
pub const S_ISGID: ::c_int = 0x400;
60+
pub const S_ISVTX: ::c_int = 0x200;
61+
62+
pub const S_IFIFO: mode_t = 0x1000;
63+
pub const S_IFCHR: mode_t = 0x2000;
64+
pub const S_IFBLK: mode_t = 0x6000;
65+
pub const S_IFDIR: mode_t = 0x4000;
66+
pub const S_IFREG: mode_t = 0x8000;
67+
pub const S_IFLNK: mode_t = 0xA000;
68+
pub const S_IFSOCK: mode_t = 0xC000;
69+
pub const S_IFMT: mode_t = 0xF000;
70+
pub const S_IEXEC: mode_t = 0x40;
71+
pub const S_IWRITE: mode_t = 0x80;
72+
pub const S_IREAD: mode_t = 0x100;
73+
pub const S_IRWXU: mode_t = 0x1C0;
74+
pub const S_IXUSR: mode_t = 0x40;
75+
pub const S_IWUSR: mode_t = 0x80;
76+
pub const S_IRUSR: mode_t = 0x100;
77+
pub const S_IRWXG: mode_t = 0x38;
78+
pub const S_IXGRP: mode_t = 0x8;
79+
pub const S_IWGRP: mode_t = 0x10;
80+
pub const S_IRGRP: mode_t = 0x20;
81+
pub const S_IRWXO: mode_t = 0x7;
82+
pub const S_IXOTH: mode_t = 0x1;
83+
pub const S_IWOTH: mode_t = 0x2;
84+
pub const S_IROTH: mode_t = 0x4;
85+
5586
extern {
5687
pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
5788
pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t)

0 commit comments

Comments
 (0)