diff options
author | bors <bors@rust-lang.org> | 2021-06-01 16:38:33 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2021-06-01 16:38:33 +0000 |
commit | 86dff58336e037b88ae8279326960cca99f9ea4b (patch) | |
tree | 64004eb829efa21c7a3c6573c91efd924db3b227 | |
parent | 0ea548a1e9fdf180f85a8ddeedc42fd46361852e (diff) | |
parent | a32895f2636091d38e7e6fc5e26ee561d7b20b65 (diff) | |
download | rust-libc-86dff58336e037b88ae8279326960cca99f9ea4b.tar.gz |
Auto merge of #2210 - sunfishcode:sunfishcode/wasi-o-cloexec, r=Amanieu
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.
-rw-r--r-- | src/wasi.rs | 1 |
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; |