diff options
author | bors <bors@rust-lang.org> | 2021-05-25 11:56:21 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2021-05-25 11:56:21 +0000 |
commit | 74779489b93d060468767a71e1fc2a0de1d63e4c (patch) | |
tree | 5c8d7528b1a29da50458b0f6ce9b9640dab333ac | |
parent | 34ddde5a1d97d8101859b50f6bce4d3194404330 (diff) | |
parent | 0bbbccf509e76bc4312532d0f69a330094bed244 (diff) | |
download | rust-libc-74779489b93d060468767a71e1fc2a0de1d63e4c.tar.gz |
Auto merge of #2194 - coolreader18:windows-fcntl, r=JohnTitor
Add all O_* codes from fcntl.h on windows
-rwxr-xr-x | libc-test/build.rs | 2 | ||||
-rw-r--r-- | libc-test/semver/windows.txt | 21 | ||||
-rw-r--r-- | src/windows/mod.rs | 31 |
3 files changed, 38 insertions, 16 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs index 314da1e3e5..bd6787cd3d 100755 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -584,6 +584,8 @@ fn test_windows(target: &str) { // FIXME: API error: // SIG_ERR type is "void (*)(int)", not "int" "SIG_ERR" => true, + // FIXME: newer windows-gnu environment on CI? + "_O_OBTAIN_DIR" if gnu => true, _ => false, } }); diff --git a/libc-test/semver/windows.txt b/libc-test/semver/windows.txt index 6246edce65..eaa7790898 100644 --- a/libc-test/semver/windows.txt +++ b/libc-test/semver/windows.txt @@ -94,16 +94,25 @@ LC_NUMERIC LC_TIME L_tmpnam NSIG +O_RDONLY +O_WRONLY +O_RDWR O_APPEND -O_BINARY O_CREAT +O_TRUNC O_EXCL -O_NOINHERIT -O_RDONLY -O_RDWR O_TEXT -O_TRUNC -O_WRONLY +O_BINARY +_O_WTEXT +_O_U16TEXT +_O_U8TEXT +O_RAW +O_NOINHERIT +O_TEMPORARY +_O_SHORT_LIVED +_O_OBTAIN_DIR +O_SEQUENTIAL +O_RANDOM RAND_MAX SEEK_CUR SEEK_END diff --git a/src/windows/mod.rs b/src/windows/mod.rs index f64aa2f971..377a6c75f9 100644 --- a/src/windows/mod.rs +++ b/src/windows/mod.rs @@ -117,16 +117,27 @@ pub const BUFSIZ: ::c_uint = 512; pub const FOPEN_MAX: ::c_uint = 20; pub const FILENAME_MAX: ::c_uint = 260; -pub const O_RDONLY: ::c_int = 0; -pub const O_WRONLY: ::c_int = 1; -pub const O_RDWR: ::c_int = 2; -pub const O_APPEND: ::c_int = 8; -pub const O_CREAT: ::c_int = 256; -pub const O_EXCL: ::c_int = 1024; -pub const O_TEXT: ::c_int = 16384; -pub const O_BINARY: ::c_int = 32768; -pub const O_NOINHERIT: ::c_int = 128; -pub const O_TRUNC: ::c_int = 512; +// fcntl.h +pub const O_RDONLY: ::c_int = 0x0000; +pub const O_WRONLY: ::c_int = 0x0001; +pub const O_RDWR: ::c_int = 0x0002; +pub const O_APPEND: ::c_int = 0x0008; +pub const O_CREAT: ::c_int = 0x0100; +pub const O_TRUNC: ::c_int = 0x0200; +pub const O_EXCL: ::c_int = 0x0400; +pub const O_TEXT: ::c_int = 0x4000; +pub const O_BINARY: ::c_int = 0x8000; +pub const _O_WTEXT: ::c_int = 0x10000; +pub const _O_U16TEXT: ::c_int = 0x20000; +pub const _O_U8TEXT: ::c_int = 0x40000; +pub const O_RAW: ::c_int = O_BINARY; +pub const O_NOINHERIT: ::c_int = 0x0080; +pub const O_TEMPORARY: ::c_int = 0x0040; +pub const _O_SHORT_LIVED: ::c_int = 0x1000; +pub const _O_OBTAIN_DIR: ::c_int = 0x2000; +pub const O_SEQUENTIAL: ::c_int = 0x0020; +pub const O_RANDOM: ::c_int = 0x0010; + pub const S_IFCHR: ::c_int = 8192; pub const S_IFDIR: ::c_int = 16384; pub const S_IFREG: ::c_int = 32768; |