Skip to content

Commit b69ce75

Browse files
committed
gnu: Update F_SETLK and F_SETLKW for 64-bit time
Also add the F_[SG]ET*64 constants.
1 parent d44e121 commit b69ce75

File tree

1 file changed

+15
-6
lines changed
  • src/unix/linux_like/linux/gnu/b32

1 file changed

+15
-6
lines changed

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,6 @@ cfg_if! {
188188

189189
pub const PTRACE_DETACH: ::c_uint = 11;
190190

191-
pub const F_SETLK: ::c_int = 8;
192-
pub const F_SETLKW: ::c_int = 9;
193-
194191
pub const F_RDLCK: ::c_int = 1;
195192
pub const F_WRLCK: ::c_int = 2;
196193
pub const F_UNLCK: ::c_int = 3;
@@ -234,9 +231,6 @@ cfg_if! {
234231

235232
pub const PTRACE_DETACH: ::c_uint = 17;
236233

237-
pub const F_SETLK: ::c_int = 6;
238-
pub const F_SETLKW: ::c_int = 7;
239-
240234
pub const F_RDLCK: ::c_int = 0;
241235
pub const F_WRLCK: ::c_int = 1;
242236
pub const F_UNLCK: ::c_int = 2;
@@ -272,6 +266,21 @@ cfg_if! {
272266
pub const EFD_CLOEXEC: ::c_int = 0x80000;
273267
}
274268
}
269+
cfg_if! {
270+
if #[cfg(target_arch = "sparc")] {
271+
pub const F_SETLK: ::c_int = 8;
272+
pub const F_SETLKW: ::c_int = 9;
273+
} else if #[cfg(all(gnu_time64_abi, target_arch = "mips"))] {
274+
pub const F_SETLK: ::c_int = 34;
275+
pub const F_SETLKW: ::c_int = 35;
276+
} else if #[cfg(gnu_time64_abi)] {
277+
pub const F_SETLK: ::c_int = 13;
278+
pub const F_SETLKW: ::c_int = 14;
279+
} else {
280+
pub const F_SETLK: ::c_int = 6;
281+
pub const F_SETLKW: ::c_int = 7;
282+
}
283+
}
275284

276285
#[cfg(target_endian = "little")]
277286
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = pthread_mutex_t {

0 commit comments

Comments
 (0)