| ... | ... | @@ -277,22 +277,23 @@ pub const lookupflags_t = u32; |
| 277 | 277 | pub const LOOKUP_SYMLINK_FOLLOW: lookupflags_t = 0x00000001; |
| 278 | 278 | |
| 279 | 279 | pub usingnamespace if (builtin.link_libc) struct { |
| 280 | // Derived from https://github.com/WebAssembly/wasi-libc/blob/main/expected/wasm32-wasi/predefined-macros.txt |
| 280 | 281 | pub const O_ACCMODE = (O_EXEC | O_RDWR | O_SEARCH); |
| 281 | | pub const O_APPEND = 1 << 0; // = __WASI_FDFLAGS_APPEND |
| 282 | pub const O_APPEND = FDFLAG_APPEND; |
| 282 | 283 | pub const O_CLOEXEC = (0); |
| 283 | 284 | pub const O_CREAT = ((1 << 0) << 12); // = __WASI_OFLAGS_CREAT << 12 |
| 284 | 285 | pub const O_DIRECTORY = ((1 << 1) << 12); // = __WASI_OFLAGS_DIRECTORY << 12 |
| 285 | | pub const O_DSYNC = (1 << 1); // = __WASI_FDFLAGS_DSYNC |
| 286 | pub const O_DSYNC = FDFLAG_DSYNC; |
| 286 | 287 | pub const O_EXCL = ((1 << 2) << 12); // = __WASI_OFLAGS_EXCL << 12 |
| 287 | 288 | pub const O_EXEC = (0x02000000); |
| 288 | 289 | pub const O_NOCTTY = (0); |
| 289 | 290 | pub const O_NOFOLLOW = (0x01000000); |
| 290 | | pub const O_NONBLOCK = (1 << 2); // = __WASI_FDFLAGS_NONBLOCK |
| 291 | pub const O_NONBLOCK = (1 << FDFLAG_NONBLOCK); |
| 291 | 292 | pub const O_RDONLY = (0x04000000); |
| 292 | 293 | pub const O_RDWR = (O_RDONLY | O_WRONLY); |
| 293 | | pub const O_RSYNC = (1 << 3); // = __WASI_FDFLAGS_RSYNC |
| 294 | pub const O_RSYNC = (1 << FDFLAG_RSYNC); |
| 294 | 295 | pub const O_SEARCH = (0x08000000); |
| 295 | | pub const O_SYNC = (1 << 4); // = __WASI_FDFLAGS_SYNC |
| 296 | pub const O_SYNC = (1 << FDFLAG_SYNC); |
| 296 | 297 | pub const O_TRUNC = ((1 << 3) << 12); // = __WASI_OFLAGS_TRUNC << 12 |
| 297 | 298 | pub const O_TTY_INIT = (0); |
| 298 | 299 | pub const O_WRONLY = (0x10000000); |
| ... | ... | @@ -476,9 +477,9 @@ pub const S_IFREG = 0x8000; |
| 476 | 477 | // There's no concept of UNIX domain socket but we define this value here in order to line with other OSes. |
| 477 | 478 | pub const S_IFSOCK = 0x1; |
| 478 | 479 | |
| 479 | | pub const SEEK_SET = 0x0; // = __WASI_WHENCE_SET |
| 480 | | pub const SEEK_CUR = 0x1; // = __WASI_WHENCE_CUR |
| 481 | | pub const SEEK_END = 0x2; // = __WASI_WHENCE_END |
| 480 | pub const SEEK_SET = WHENCE_SET; |
| 481 | pub const SEEK_CUR = WHENCE_CUR; |
| 482 | pub const SEEK_END = WHENCE_END; |
| 482 | 483 | |
| 483 | 484 | pub const LOCK_SH = 0x1; |
| 484 | 485 | pub const LOCK_EX = 0x2; |