Skip to content

Commit 339e7ab

Browse files
committed
gnu: Update F_GETLK for gnu_file_offset_bits64
gnu_file_offset_bits64 means _FILE_OFFSET_BITS=64.
1 parent 3d41689 commit 339e7ab

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

src/unix/linux_like/linux/gnu/b32/arm/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,13 @@ pub const MCL_ONFAULT: c_int = 0x0004;
397397
pub const POLLWRNORM: c_short = 0x100;
398398
pub const POLLWRBAND: c_short = 0x200;
399399

400-
pub const F_GETLK: c_int = 5;
400+
cfg_if! {
401+
if #[cfg(gnu_file_offset_bits64)] {
402+
pub const F_GETLK: c_int = 12;
403+
} else {
404+
pub const F_GETLK: c_int = 5;
405+
}
406+
}
401407
pub const F_GETOWN: c_int = 9;
402408
pub const F_SETOWN: c_int = 8;
403409

src/unix/linux_like/linux/gnu/b32/mips/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,13 @@ pub const MAP_HUGETLB: c_int = 0x080000;
745745

746746
pub const EFD_NONBLOCK: c_int = 0x80;
747747

748-
pub const F_GETLK: c_int = 14;
748+
cfg_if! {
749+
if #[cfg(gnu_file_offset_bits64)] {
750+
pub const F_GETLK: c_int = 33;
751+
} else {
752+
pub const F_GETLK: c_int = 14;
753+
}
754+
}
749755
pub const F_GETOWN: c_int = 23;
750756
pub const F_SETOWN: c_int = 24;
751757

src/unix/linux_like/linux/gnu/b32/powerpc.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,13 @@ pub const MCL_ONFAULT: c_int = 0x8000;
301301
pub const POLLWRNORM: c_short = 0x100;
302302
pub const POLLWRBAND: c_short = 0x200;
303303

304-
pub const F_GETLK: c_int = 5;
304+
cfg_if! {
305+
if #[cfg(gnu_file_offset_bits64)] {
306+
pub const F_GETLK: c_int = 12;
307+
} else {
308+
pub const F_GETLK: c_int = 5;
309+
}
310+
}
305311
pub const F_GETOWN: c_int = 9;
306312
pub const F_SETOWN: c_int = 8;
307313

src/unix/linux_like/linux/gnu/b32/x86/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,13 @@ pub const SA_NOCLDWAIT: c_int = 0x00000002;
499499
pub const SOCK_STREAM: c_int = 1;
500500
pub const SOCK_DGRAM: c_int = 2;
501501

502-
pub const F_GETLK: c_int = 5;
502+
cfg_if! {
503+
if #[cfg(gnu_file_offset_bits64)] {
504+
pub const F_GETLK: c_int = 12;
505+
} else {
506+
pub const F_GETLK: c_int = 5;
507+
}
508+
}
503509
pub const F_GETOWN: c_int = 9;
504510
pub const F_SETOWN: c_int = 8;
505511

0 commit comments

Comments
 (0)