Skip to content

Commit b553d1f

Browse files
xbjfktgross35
authored andcommitted
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. (backport <rust-lang#4443>) (cherry picked from commit 686aa7a)
1 parent a28ee2b commit b553d1f

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
@@ -4329,6 +4329,10 @@ fn test_linux(target: &str) {
43294329
{
43304330
return true;
43314331
}
4332+
// Values changed in newer musl versions on these arches
4333+
if old_musl && (riscv64 || x86_64) && name == "O_LARGEFILE" {
4334+
return true;
4335+
}
43324336
}
43334337
match name {
43344338
// 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)