summaryrefslogtreecommitdiff
path: root/src/wasi.rs
diff options
context:
space:
mode:
authorDan Gohman <dev@sunfishcode.online>2020-09-03 15:24:00 -0700
committerDan Gohman <dev@sunfishcode.online>2020-09-03 23:05:34 -0700
commita02da55c4b526e88769da6b745037999d8cc37d3 (patch)
treed24c3561d7cf660bdf49e29029d4a4bdc0061cdf /src/wasi.rs
parentaf7749c1e52fbf4da14c08e3ec654c8119f079a8 (diff)
downloadrust-libc-a02da55c4b526e88769da6b745037999d8cc37d3.tar.gz
Define several more constants for WASI.
Define `O_NOCTTY`, `R_OK`, `POLLIN`, and related constants using the current values from WASI libc.
Diffstat (limited to 'src/wasi.rs')
-rw-r--r--src/wasi.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/wasi.rs b/src/wasi.rs
index 6a26858694..12db506417 100644
--- a/src/wasi.rs
+++ b/src/wasi.rs
@@ -202,6 +202,7 @@ pub const O_SEARCH: c_int = 0x08000000;
pub const O_WRONLY: c_int = 0x10000000;
pub const O_RDWR: c_int = O_WRONLY | O_RDONLY;
pub const O_ACCMODE: c_int = O_EXEC | O_RDWR | O_SEARCH;
+pub const O_NOCTTY: c_int = 0x0;
pub const POSIX_FADV_DONTNEED: c_int = 4;
pub const POSIX_FADV_NOREUSE: c_int = 5;
pub const POSIX_FADV_NORMAL: c_int = 0;
@@ -230,6 +231,17 @@ pub const DT_REG: u8 = 4;
pub const DT_LNK: u8 = 7;
pub const FIONREAD: c_int = 1;
pub const FIONBIO: c_int = 2;
+pub const F_OK: ::c_int = 0;
+pub const R_OK: ::c_int = 4;
+pub const W_OK: ::c_int = 2;
+pub const X_OK: ::c_int = 1;
+pub const POLLIN: ::c_short = 0x1;
+pub const POLLOUT: ::c_short = 0x2;
+pub const POLLERR: ::c_short = 0x1000;
+pub const POLLHUP: ::c_short = 0x2000;
+pub const POLLNVAL: ::c_short = 0x4000;
+pub const POLLRDNORM: ::c_short = 0x1;
+pub const POLLWRNORM: ::c_short = 0x2;
pub const E2BIG: c_int = 1;
pub const EACCES: c_int = 2;