Skip to content

Commit 4bab9f4

Browse files
committed
Auto merge of #2264 - sunfishcode:sunfishcode/wasi-mode-bits, r=JohnTitor
Define `S_I{R,W,X}{USR,GRP,OTH}` and `S_IS{VTX,UID,GID}` for wasi. WASI doesn't have full permissions setting, but it's gaining some support, so define the POSIX names that wasi-libc defines, and let WASI libc and WASI sort out what to do with them.
2 parents a273a07 + 4f8f778 commit 4bab9f4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/wasi.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,18 @@ pub const S_IFREG: mode_t = 32768;
226226
pub const S_IFLNK: mode_t = 40960;
227227
pub const S_IFSOCK: mode_t = 49152;
228228
pub const S_IFMT: mode_t = 57344;
229+
pub const S_IXOTH: mode_t = 0x1;
230+
pub const S_IWOTH: mode_t = 0x2;
231+
pub const S_IROTH: mode_t = 0x4;
232+
pub const S_IXGRP: mode_t = 0x8;
233+
pub const S_IWGRP: mode_t = 0x10;
234+
pub const S_IRGRP: mode_t = 0x20;
235+
pub const S_IXUSR: mode_t = 0x40;
236+
pub const S_IWUSR: mode_t = 0x80;
237+
pub const S_IRUSR: mode_t = 0x100;
238+
pub const S_ISVTX: mode_t = 0x200;
239+
pub const S_ISGID: mode_t = 0x400;
240+
pub const S_ISUID: mode_t = 0x800;
229241
pub const DT_UNKNOWN: u8 = 0;
230242
pub const DT_BLK: u8 = 1;
231243
pub const DT_CHR: u8 = 2;

0 commit comments

Comments
 (0)