summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-08-16 09:59:48 +0000
committerbors <bors@rust-lang.org>2022-08-16 09:59:48 +0000
commit1d38aa26c54772d76fcf096a41794e02bcfed15e (patch)
treed777da6df87441962c049b0b0c7f38d74d80d9a5
parent08c0f2c00a5dfa10a9fbc74150b7dbecf2164682 (diff)
parent6844aff7b4d764de5ba2dd9298cb1eebecce83b8 (diff)
downloadrust-libc-1d38aa26c54772d76fcf096a41794e02bcfed15e.tar.gz
Auto merge of #2875 - jam1garner:fix-mips-o-largefile, r=JohnTitor
Fix incorrect constant for O_LARGEFILE on mips64-linux-musl Changes `O_LARGEFILE` from `0` to `0x2000` Bash script used for ensuring constant is correct: ```sh #!/bin/bash echo " #include <fcntl.h> int largefile() { return O_LARGEFILE; } " | mips64-linux-musl-gcc -c -O2 musl_o_largefile.c -o temp.o mips64-linux-musl-objdump -d temp.o | grep -A2 largefile ``` Output: ```asm 0000000000000000 <largefile>: 0: 03e00008 jr ra 4: 24022000 li v0,8192 ; 0x2000 ``` Link to relevant portion of kernel source, shows that it should match mips32 musl (which currently has a value of 0x2000 as well). I believe the reason #2738 had this value incorrect was because it's 0 for glibc on mips64 (to specify it's the default, I believe).
-rw-r--r--src/unix/linux_like/linux/musl/b64/mips64.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/unix/linux_like/linux/musl/b64/mips64.rs b/src/unix/linux_like/linux/musl/b64/mips64.rs
index cb9bb930d8..1ed13f66bf 100644
--- a/src/unix/linux_like/linux/musl/b64/mips64.rs
+++ b/src/unix/linux_like/linux/musl/b64/mips64.rs
@@ -458,7 +458,7 @@ pub const O_SYNC: ::c_int = 0x4010;
pub const O_RSYNC: ::c_int = 0x4010;
pub const O_DSYNC: ::c_int = 0x10;
pub const O_ASYNC: ::c_int = 0x1000;
-pub const O_LARGEFILE: ::c_int = 0;
+pub const O_LARGEFILE: ::c_int = 0x2000;
pub const EDEADLK: ::c_int = 45;
pub const ENAMETOOLONG: ::c_int = 78;