Skip to content

Commit 686aa7a

Browse files
committed
musl: Fix O_LARGEFILE constant value.
This was accidentally set to 0 in upstream, but fixed in commit b8b729b. If running with prior versions without that commit, this commit effectively backports it.
1 parent 85a7c85 commit 686aa7a

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

libc-test/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4255,6 +4255,10 @@ fn test_linux(target: &str) {
42554255
{
42564256
return true;
42574257
}
4258+
// Values changed in newer musl versions on these arches
4259+
if old_musl && (riscv64 || x86_64) && name == "O_LARGEFILE" {
4260+
return true;
4261+
}
42584262
}
42594263
match name {
42604264
// These constants are not available if gnu headers have been included

src/unix/linux_like/linux/musl/b64/riscv64/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ pub const SYS_landlock_restrict_self: c_long = 446;
432432
pub const O_APPEND: c_int = 1024;
433433
pub const O_DIRECT: c_int = 0x4000;
434434
pub const O_DIRECTORY: c_int = 0x10000;
435-
pub const O_LARGEFILE: c_int = 0;
435+
pub const O_LARGEFILE: c_int = 0o100000;
436436
pub const O_NOFOLLOW: c_int = 0x20000;
437437
pub const O_CREAT: c_int = 64;
438438
pub const O_EXCL: c_int = 128;

src/unix/linux_like/linux/musl/b64/x86_64/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ pub const MAP_32BIT: c_int = 0x0040;
701701
pub const O_APPEND: c_int = 1024;
702702
pub const O_DIRECT: c_int = 0x4000;
703703
pub const O_DIRECTORY: c_int = 0x10000;
704-
pub const O_LARGEFILE: c_int = 0;
704+
pub const O_LARGEFILE: c_int = 0o0100000;
705705
pub const O_NOFOLLOW: c_int = 0x20000;
706706
pub const O_CREAT: c_int = 64;
707707
pub const O_EXCL: c_int = 128;

0 commit comments

Comments
 (0)