Skip to content

Commit

Permalink
gnu: Update F_SETLK and F_SETLKW for 64-bit time
Browse files Browse the repository at this point in the history
Also add the F_[SG]ET*64 constants.
  • Loading branch information
snogge committed Feb 7, 2025
1 parent 8c37329 commit 459d0ca
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/unix/linux_like/linux/gnu/b32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,6 @@ cfg_if! {

pub const PTRACE_DETACH: c_uint = 11;

pub const F_SETLK: c_int = 8;
pub const F_SETLKW: c_int = 9;

pub const F_RDLCK: c_int = 1;
pub const F_WRLCK: c_int = 2;
pub const F_UNLCK: c_int = 3;
Expand Down Expand Up @@ -291,9 +288,6 @@ cfg_if! {

pub const PTRACE_DETACH: c_uint = 17;

pub const F_SETLK: c_int = 6;
pub const F_SETLKW: c_int = 7;

pub const F_RDLCK: c_int = 0;
pub const F_WRLCK: c_int = 1;
pub const F_UNLCK: c_int = 2;
Expand Down Expand Up @@ -329,6 +323,21 @@ cfg_if! {
pub const EFD_CLOEXEC: c_int = 0x80000;
}
}
cfg_if! {
if #[cfg(target_arch = "sparc")] {
pub const F_SETLK: c_int = 8;
pub const F_SETLKW: c_int = 9;
} else if #[cfg(all(gnu_time64_abi, target_arch = "mips"))] {
pub const F_SETLK: c_int = 34;
pub const F_SETLKW: c_int = 35;
} else if #[cfg(gnu_time64_abi)] {
pub const F_SETLK: c_int = 13;
pub const F_SETLKW: c_int = 14;
} else {
pub const F_SETLK: c_int = 6;
pub const F_SETLKW: c_int = 7;
}
}

#[cfg(target_endian = "little")]
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
Expand Down

0 comments on commit 459d0ca

Please sign in to comment.