Skip to content

Commit 6ed2bc8

Browse files
snoggetgross35
authored andcommitted
gnu: Update F_SETLK and F_SETLKW for gnu_file_offset_bits64
1 parent 862ba8a commit 6ed2bc8

File tree

1 file changed

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

1 file changed

+18
-6
lines changed

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

+18-6
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,6 @@ cfg_if! {
177177

178178
pub const PTRACE_DETACH: c_uint = 11;
179179

180-
pub const F_SETLK: c_int = 8;
181-
pub const F_SETLKW: c_int = 9;
182-
183180
pub const F_RDLCK: c_int = 1;
184181
pub const F_WRLCK: c_int = 2;
185182
pub const F_UNLCK: c_int = 3;
@@ -223,9 +220,6 @@ cfg_if! {
223220

224221
pub const PTRACE_DETACH: c_uint = 17;
225222

226-
pub const F_SETLK: c_int = 6;
227-
pub const F_SETLKW: c_int = 7;
228-
229223
pub const F_RDLCK: c_int = 0;
230224
pub const F_WRLCK: c_int = 1;
231225
pub const F_UNLCK: c_int = 2;
@@ -261,6 +255,24 @@ cfg_if! {
261255
pub const EFD_CLOEXEC: c_int = 0x80000;
262256
}
263257
}
258+
cfg_if! {
259+
if #[cfg(target_arch = "sparc")] {
260+
pub const F_SETLK: c_int = 8;
261+
pub const F_SETLKW: c_int = 9;
262+
} else if #[cfg(all(
263+
gnu_file_offset_bits64,
264+
any(target_arch = "mips", target_arch = "mips32r6")
265+
))] {
266+
pub const F_SETLK: c_int = 34;
267+
pub const F_SETLKW: c_int = 35;
268+
} else if #[cfg(gnu_file_offset_bits64)] {
269+
pub const F_SETLK: c_int = 13;
270+
pub const F_SETLKW: c_int = 14;
271+
} else {
272+
pub const F_SETLK: c_int = 6;
273+
pub const F_SETLKW: c_int = 7;
274+
}
275+
}
264276

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

0 commit comments

Comments
 (0)