Skip to content

Commit 1d38aa2

Browse files
committed
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).
2 parents 08c0f2c + 6844aff commit 1d38aa2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/unix/linux_like/linux/musl/b64/mips64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ pub const O_SYNC: ::c_int = 0x4010;
458458
pub const O_RSYNC: ::c_int = 0x4010;
459459
pub const O_DSYNC: ::c_int = 0x10;
460460
pub const O_ASYNC: ::c_int = 0x1000;
461-
pub const O_LARGEFILE: ::c_int = 0;
461+
pub const O_LARGEFILE: ::c_int = 0x2000;
462462

463463
pub const EDEADLK: ::c_int = 45;
464464
pub const ENAMETOOLONG: ::c_int = 78;

0 commit comments

Comments
 (0)