summaryrefslogtreecommitdiff
path: root/src/wasi.rs
diff options
context:
space:
mode:
authorDan Gohman <dev@sunfishcode.online>2021-06-01 08:36:42 -0700
committerDan Gohman <dev@sunfishcode.online>2021-06-01 08:38:12 -0700
commita32895f2636091d38e7e6fc5e26ee561d7b20b65 (patch)
tree0bbd5d202d4ce823f99fded0443b7be11f7e79cb /src/wasi.rs
parentaf64038eb6dc8c5d60a9af1e893241c5f1e65179 (diff)
downloadrust-libc-a32895f2636091d38e7e6fc5e26ee561d7b20b65.tar.gz
Define `O_CLOEXEC` for WASI.
`O_CLOEXEC` is defined to be 0 in WASI libc: https://github.com/WebAssembly/wasi-libc/blob/659ff414560721b1660a19685110e484a081c3d4/libc-bottom-half/headers/public/__header_fcntl.h#L24 so define it accordingly in Rust's `libc` bindings.
Diffstat (limited to 'src/wasi.rs')
-rw-r--r--src/wasi.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wasi.rs b/src/wasi.rs
index 6aefff8a2f..5ef5438c68 100644
--- a/src/wasi.rs
+++ b/src/wasi.rs
@@ -201,6 +201,7 @@ pub const O_EXEC: c_int = 0x02000000;
pub const O_RDONLY: c_int = 0x04000000;
pub const O_SEARCH: c_int = 0x08000000;
pub const O_WRONLY: c_int = 0x10000000;
+pub const O_CLOEXEC: c_int = 0x0;
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;