Skip to content

Commit a02da55

Browse files
committed
Define several more constants for WASI.
Define `O_NOCTTY`, `R_OK`, `POLLIN`, and related constants using the current values from WASI libc.
1 parent af7749c commit a02da55

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
@@ -202,6 +202,7 @@ pub const O_SEARCH: c_int = 0x08000000;
202202
pub const O_WRONLY: c_int = 0x10000000;
203203
pub const O_RDWR: c_int = O_WRONLY | O_RDONLY;
204204
pub const O_ACCMODE: c_int = O_EXEC | O_RDWR | O_SEARCH;
205+
pub const O_NOCTTY: c_int = 0x0;
205206
pub const POSIX_FADV_DONTNEED: c_int = 4;
206207
pub const POSIX_FADV_NOREUSE: c_int = 5;
207208
pub const POSIX_FADV_NORMAL: c_int = 0;
@@ -230,6 +231,17 @@ pub const DT_REG: u8 = 4;
230231
pub const DT_LNK: u8 = 7;
231232
pub const FIONREAD: c_int = 1;
232233
pub const FIONBIO: c_int = 2;
234+
pub const F_OK: ::c_int = 0;
235+
pub const R_OK: ::c_int = 4;
236+
pub const W_OK: ::c_int = 2;
237+
pub const X_OK: ::c_int = 1;
238+
pub const POLLIN: ::c_short = 0x1;
239+
pub const POLLOUT: ::c_short = 0x2;
240+
pub const POLLERR: ::c_short = 0x1000;
241+
pub const POLLHUP: ::c_short = 0x2000;
242+
pub const POLLNVAL: ::c_short = 0x4000;
243+
pub const POLLRDNORM: ::c_short = 0x1;
244+
pub const POLLWRNORM: ::c_short = 0x2;
233245

234246
pub const E2BIG: c_int = 1;
235247
pub const EACCES: c_int = 2;

0 commit comments

Comments
 (0)