From dc1bc52dd6c10b99041f9e6189d6fd3541c714c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Fri, 17 Oct 2025 00:36:16 +0200 Subject: [PATCH] std.os.linux: retranslate F_* constants and Flock struct, and move out of arch bits Flock is now equivalent to struct flock64, and the related F.* constants map to the 64-bit variants on 32-bit systems. --- lib/std/os/linux.zig | 68 ++++++++++++++++++++++++++++++-- lib/std/os/linux/aarch64.zig | 35 ---------------- lib/std/os/linux/arm.zig | 36 ----------------- lib/std/os/linux/hexagon.zig | 33 ---------------- lib/std/os/linux/loongarch64.zig | 24 ----------- lib/std/os/linux/m68k.zig | 34 ---------------- lib/std/os/linux/mips.zig | 36 ----------------- lib/std/os/linux/mips64.zig | 36 ----------------- lib/std/os/linux/powerpc.zig | 34 ---------------- lib/std/os/linux/powerpc64.zig | 35 ---------------- lib/std/os/linux/riscv32.zig | 33 ---------------- lib/std/os/linux/riscv64.zig | 33 ---------------- lib/std/os/linux/s390x.zig | 28 ------------- lib/std/os/linux/sparc64.zig | 31 --------------- lib/std/os/linux/x86.zig | 32 --------------- lib/std/os/linux/x86_64.zig | 38 ++---------------- 16 files changed, 68 insertions(+), 498 deletions(-) diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index a3b675a379..ce5eec59f5 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -88,8 +88,6 @@ pub fn clone( } pub const ARCH = arch_bits.ARCH; -pub const F = arch_bits.F; -pub const Flock = arch_bits.Flock; pub const HWCAP = arch_bits.HWCAP; pub const SC = arch_bits.SC; pub const Stat = arch_bits.Stat; @@ -110,7 +108,7 @@ pub const IOCTL = @import("linux/ioctl.zig"); pub const SECCOMP = @import("linux/seccomp.zig"); pub const syscalls = @import("linux/syscalls.zig"); -pub const SYS = switch (@import("builtin").cpu.arch) { +pub const SYS = switch (native_arch) { .arc => syscalls.Arc, .arm, .armeb, .thumb, .thumbeb => syscalls.Arm, .aarch64, .aarch64_be => syscalls.Arm64, @@ -1596,6 +1594,70 @@ pub fn waitid(id_type: P, id: i32, infop: *siginfo_t, flags: u32) usize { return syscall5(.waitid, @intFromEnum(id_type), @as(usize, @bitCast(@as(isize, id))), @intFromPtr(infop), flags, 0); } +pub const F = struct { + pub const DUPFD = 0; + pub const GETFD = 1; + pub const SETFD = 2; + pub const GETFL = 3; + pub const SETFL = 4; + + pub const GETLK = GET_SET_LK.GETLK; + pub const SETLK = GET_SET_LK.SETLK; + pub const SETLKW = GET_SET_LK.SETLKW; + + const GET_SET_LK = if (@sizeOf(usize) == 64) extern struct { + pub const GETLK = if (is_mips) 14 else if (is_sparc) 7 else 5; + pub const SETLK = if (is_mips) 6 else if (is_sparc) 8 else 6; + pub const SETLKW = if (is_mips) 7 else if (is_sparc) 9 else 7; + } else extern struct { + // Ensure that 32-bit code uses the large-file variants (GETLK64, etc). + + pub const GETLK = if (is_mips) 33 else 12; + pub const SETLK = if (is_mips) 34 else 13; + pub const SETLKW = if (is_mips) 35 else 14; + }; + + pub const SETOWN = if (is_mips) 24 else if (is_sparc) 6 else 8; + pub const GETOWN = if (is_mips) 23 else if (is_sparc) 5 else 9; + + pub const SETSIG = 10; + pub const GETSIG = 11; + + pub const SETOWN_EX = 15; + pub const GETOWN_EX = 16; + + pub const GETOWNER_UIDS = 17; + + pub const OFD_GETLK = 36; + pub const OFD_SETLK = 37; + pub const OFD_SETLKW = 38; + + pub const RDLCK = if (is_sparc) 1 else 0; + pub const WRLCK = if (is_sparc) 2 else 1; + pub const UNLCK = if (is_sparc) 3 else 2; +}; + +pub const F_OWNER = enum(i32) { + TID = 0, + PID = 1, + PGRP = 2, + _, +}; + +pub const f_owner_ex = extern struct { + type: F_OWNER, + pid: pid_t, +}; + +pub const Flock = extern struct { + type: i16, + whence: i16, + start: off_t, + len: off_t, + pid: pid_t, + _unused: if (is_sparc) i16 else void, +}; + pub fn fcntl(fd: fd_t, cmd: i32, arg: usize) usize { if (@hasField(SYS, "fcntl64")) { return syscall3(.fcntl64, @as(usize, @bitCast(@as(isize, fd))), @as(usize, @bitCast(@as(isize, cmd))), arg); diff --git a/lib/std/os/linux/aarch64.zig b/lib/std/os/linux/aarch64.zig index 5f3d68549e..a27359bb04 100644 --- a/lib/std/os/linux/aarch64.zig +++ b/lib/std/os/linux/aarch64.zig @@ -150,46 +150,11 @@ pub fn restore_rt() callconv(.naked) noreturn { } } -pub const F = struct { - pub const DUPFD = 0; - pub const GETFD = 1; - pub const SETFD = 2; - pub const GETFL = 3; - pub const SETFL = 4; - - pub const SETOWN = 8; - pub const GETOWN = 9; - pub const SETSIG = 10; - pub const GETSIG = 11; - - pub const GETLK = 5; - pub const SETLK = 6; - pub const SETLKW = 7; - - pub const RDLCK = 0; - pub const WRLCK = 1; - pub const UNLCK = 2; - - pub const SETOWN_EX = 15; - pub const GETOWN_EX = 16; - - pub const GETOWNER_UIDS = 17; -}; - pub const VDSO = struct { pub const CGT_SYM = "__kernel_clock_gettime"; pub const CGT_VER = "LINUX_2.6.39"; }; -pub const Flock = extern struct { - type: i16, - whence: i16, - start: off_t, - len: off_t, - pid: pid_t, - __unused: [4]u8, -}; - pub const blksize_t = i32; pub const nlink_t = u32; pub const time_t = i64; diff --git a/lib/std/os/linux/arm.zig b/lib/std/os/linux/arm.zig index 15c371c53c..6cdca3787e 100644 --- a/lib/std/os/linux/arm.zig +++ b/lib/std/os/linux/arm.zig @@ -159,32 +159,6 @@ pub fn restore_rt() callconv(.naked) noreturn { } } -pub const F = struct { - pub const DUPFD = 0; - pub const GETFD = 1; - pub const SETFD = 2; - pub const GETFL = 3; - pub const SETFL = 4; - - pub const SETOWN = 8; - pub const GETOWN = 9; - pub const SETSIG = 10; - pub const GETSIG = 11; - - pub const GETLK = 12; - pub const SETLK = 13; - pub const SETLKW = 14; - - pub const RDLCK = 0; - pub const WRLCK = 1; - pub const UNLCK = 2; - - pub const SETOWN_EX = 15; - pub const GETOWN_EX = 16; - - pub const GETOWNER_UIDS = 17; -}; - pub const VDSO = struct { pub const CGT_SYM = "__vdso_clock_gettime"; pub const CGT_VER = "LINUX_2.6"; @@ -216,16 +190,6 @@ pub const HWCAP = struct { pub const EVTSTRM = 1 << 21; }; -pub const Flock = extern struct { - type: i16, - whence: i16, - __pad0: [4]u8, - start: off_t, - len: off_t, - pid: pid_t, - __unused: [4]u8, -}; - pub const blksize_t = i32; pub const nlink_t = u32; pub const time_t = i32; diff --git a/lib/std/os/linux/hexagon.zig b/lib/std/os/linux/hexagon.zig index c42de2ac25..70142617b9 100644 --- a/lib/std/os/linux/hexagon.zig +++ b/lib/std/os/linux/hexagon.zig @@ -130,39 +130,6 @@ pub fn clone() callconv(.naked) u32 { ); } -pub const F = struct { - pub const DUPFD = 0; - pub const GETFD = 1; - pub const SETFD = 2; - pub const GETFL = 3; - pub const SETFL = 4; - pub const GETLK = 5; - pub const SETLK = 6; - pub const SETLKW = 7; - pub const SETOWN = 8; - pub const GETOWN = 9; - pub const SETSIG = 10; - pub const GETSIG = 11; - - pub const RDLCK = 0; - pub const WRLCK = 1; - pub const UNLCK = 2; - - pub const SETOWN_EX = 15; - pub const GETOWN_EX = 16; - - pub const GETOWNER_UIDS = 17; -}; - -pub const Flock = extern struct { - type: i16, - whence: i16, - start: off_t, - len: off_t, - pid: pid_t, - __unused: [4]u8, -}; - pub const blksize_t = i32; pub const nlink_t = u32; pub const time_t = i32; diff --git a/lib/std/os/linux/loongarch64.zig b/lib/std/os/linux/loongarch64.zig index da2caa3d06..3e80197812 100644 --- a/lib/std/os/linux/loongarch64.zig +++ b/lib/std/os/linux/loongarch64.zig @@ -176,30 +176,6 @@ pub const Stat = extern struct { } }; -pub const F = struct { - pub const DUPFD = 0; - pub const GETFD = 1; - pub const SETFD = 2; - pub const GETFL = 3; - pub const SETFL = 4; - pub const GETLK = 5; - pub const SETLK = 6; - pub const SETLKW = 7; - pub const SETOWN = 8; - pub const GETOWN = 9; - pub const SETSIG = 10; - pub const GETSIG = 11; - - pub const RDLCK = 0; - pub const WRLCK = 1; - pub const UNLCK = 2; - - pub const SETOWN_EX = 15; - pub const GETOWN_EX = 16; - - pub const GETOWNER_UIDS = 17; -}; - pub const VDSO = struct { pub const CGT_SYM = "__vdso_clock_gettime"; pub const CGT_VER = "LINUX_5.10"; diff --git a/lib/std/os/linux/m68k.zig b/lib/std/os/linux/m68k.zig index 9febdc3087..ff2e716c00 100644 --- a/lib/std/os/linux/m68k.zig +++ b/lib/std/os/linux/m68k.zig @@ -151,32 +151,6 @@ pub fn restore_rt() callconv(.naked) noreturn { ); } -pub const F = struct { - pub const DUPFD = 0; - pub const GETFD = 1; - pub const SETFD = 2; - pub const GETFL = 3; - pub const SETFL = 4; - - pub const SETOWN = 8; - pub const GETOWN = 9; - pub const SETSIG = 10; - pub const GETSIG = 11; - - pub const GETLK = 12; - pub const SETLK = 13; - pub const SETLKW = 14; - - pub const SETOWN_EX = 15; - pub const GETOWN_EX = 16; - - pub const GETOWNER_UIDS = 17; - - pub const RDLCK = 0; - pub const WRLCK = 1; - pub const UNLCK = 2; -}; - pub const blksize_t = i32; pub const nlink_t = u32; pub const time_t = i32; @@ -186,14 +160,6 @@ pub const ino_t = u64; pub const dev_t = u64; pub const blkcnt_t = i64; -pub const Flock = extern struct { - type: i16, - whence: i16, - start: off_t, - len: off_t, - pid: pid_t, -}; - pub const Stat = extern struct { dev: dev_t, __pad: i16, diff --git a/lib/std/os/linux/mips.zig b/lib/std/os/linux/mips.zig index 3e16042ea0..0a019cc2c8 100644 --- a/lib/std/os/linux/mips.zig +++ b/lib/std/os/linux/mips.zig @@ -243,47 +243,11 @@ pub fn clone() callconv(.naked) u32 { ); } -pub const F = struct { - pub const DUPFD = 0; - pub const GETFD = 1; - pub const SETFD = 2; - pub const GETFL = 3; - pub const SETFL = 4; - - pub const SETOWN = 24; - pub const GETOWN = 23; - pub const SETSIG = 10; - pub const GETSIG = 11; - - pub const GETLK = 33; - pub const SETLK = 34; - pub const SETLKW = 35; - - pub const RDLCK = 0; - pub const WRLCK = 1; - pub const UNLCK = 2; - - pub const SETOWN_EX = 15; - pub const GETOWN_EX = 16; - - pub const GETOWNER_UIDS = 17; -}; - pub const VDSO = struct { pub const CGT_SYM = "__vdso_clock_gettime"; pub const CGT_VER = "LINUX_2.6"; }; -pub const Flock = extern struct { - type: i16, - whence: i16, - __pad0: [4]u8, - start: off_t, - len: off_t, - pid: pid_t, - __unused: [4]u8, -}; - pub const blksize_t = u32; pub const nlink_t = u32; pub const time_t = i32; diff --git a/lib/std/os/linux/mips64.zig b/lib/std/os/linux/mips64.zig index 477fb32c61..53daa99e4a 100644 --- a/lib/std/os/linux/mips64.zig +++ b/lib/std/os/linux/mips64.zig @@ -222,47 +222,11 @@ pub fn clone() callconv(.naked) u64 { ); } -pub const F = struct { - pub const DUPFD = 0; - pub const GETFD = 1; - pub const SETFD = 2; - pub const GETFL = 3; - pub const SETFL = 4; - - pub const SETOWN = 24; - pub const GETOWN = 23; - pub const SETSIG = 10; - pub const GETSIG = 11; - - pub const GETLK = 33; - pub const SETLK = 34; - pub const SETLKW = 35; - - pub const RDLCK = 0; - pub const WRLCK = 1; - pub const UNLCK = 2; - - pub const SETOWN_EX = 15; - pub const GETOWN_EX = 16; - - pub const GETOWNER_UIDS = 17; -}; - pub const VDSO = struct { pub const CGT_SYM = "__vdso_clock_gettime"; pub const CGT_VER = "LINUX_2.6"; }; -pub const Flock = extern struct { - type: i16, - whence: i16, - __pad0: [4]u8, - start: off_t, - len: off_t, - pid: pid_t, - __unused: [4]u8, -}; - pub const blksize_t = u32; pub const nlink_t = u32; pub const time_t = i32; diff --git a/lib/std/os/linux/powerpc.zig b/lib/std/os/linux/powerpc.zig index d79bcf5e94..2372668c8b 100644 --- a/lib/std/os/linux/powerpc.zig +++ b/lib/std/os/linux/powerpc.zig @@ -262,45 +262,11 @@ pub fn restore_rt() callconv(.naked) noreturn { } } -pub const F = struct { - pub const DUPFD = 0; - pub const GETFD = 1; - pub const SETFD = 2; - pub const GETFL = 3; - pub const SETFL = 4; - - pub const SETOWN = 8; - pub const GETOWN = 9; - pub const SETSIG = 10; - pub const GETSIG = 11; - - pub const GETLK = 12; - pub const SETLK = 13; - pub const SETLKW = 14; - - pub const SETOWN_EX = 15; - pub const GETOWN_EX = 16; - - pub const GETOWNER_UIDS = 17; - - pub const RDLCK = 0; - pub const WRLCK = 1; - pub const UNLCK = 2; -}; - pub const VDSO = struct { pub const CGT_SYM = "__kernel_clock_gettime"; pub const CGT_VER = "LINUX_2.6.15"; }; -pub const Flock = extern struct { - type: i16, - whence: i16, - start: off_t, - len: off_t, - pid: pid_t, -}; - pub const blksize_t = i32; pub const nlink_t = u32; pub const time_t = i32; diff --git a/lib/std/os/linux/powerpc64.zig b/lib/std/os/linux/powerpc64.zig index 14c2f47bc7..cad7143f11 100644 --- a/lib/std/os/linux/powerpc64.zig +++ b/lib/std/os/linux/powerpc64.zig @@ -247,46 +247,11 @@ pub fn restore_rt() callconv(.naked) noreturn { } } -pub const F = struct { - pub const DUPFD = 0; - pub const GETFD = 1; - pub const SETFD = 2; - pub const GETFL = 3; - pub const SETFL = 4; - - pub const SETOWN = 8; - pub const GETOWN = 9; - pub const SETSIG = 10; - pub const GETSIG = 11; - - pub const GETLK = 5; - pub const SETLK = 6; - pub const SETLKW = 7; - - pub const RDLCK = 0; - pub const WRLCK = 1; - pub const UNLCK = 2; - - pub const SETOWN_EX = 15; - pub const GETOWN_EX = 16; - - pub const GETOWNER_UIDS = 17; -}; - pub const VDSO = struct { pub const CGT_SYM = "__kernel_clock_gettime"; pub const CGT_VER = "LINUX_2.6.15"; }; -pub const Flock = extern struct { - type: i16, - whence: i16, - start: off_t, - len: off_t, - pid: pid_t, - __unused: [4]u8, -}; - pub const blksize_t = i64; pub const nlink_t = u64; pub const time_t = i64; diff --git a/lib/std/os/linux/riscv32.zig b/lib/std/os/linux/riscv32.zig index 896dbb456b..7d32c9d6b8 100644 --- a/lib/std/os/linux/riscv32.zig +++ b/lib/std/os/linux/riscv32.zig @@ -135,30 +135,6 @@ pub fn clone() callconv(.naked) u32 { ); } -pub const F = struct { - pub const DUPFD = 0; - pub const GETFD = 1; - pub const SETFD = 2; - pub const GETFL = 3; - pub const SETFL = 4; - pub const GETLK = 5; - pub const SETLK = 6; - pub const SETLKW = 7; - pub const SETOWN = 8; - pub const GETOWN = 9; - pub const SETSIG = 10; - pub const GETSIG = 11; - - pub const RDLCK = 0; - pub const WRLCK = 1; - pub const UNLCK = 2; - - pub const SETOWN_EX = 15; - pub const GETOWN_EX = 16; - - pub const GETOWNER_UIDS = 17; -}; - pub const blksize_t = i32; pub const nlink_t = u32; pub const time_t = i64; @@ -168,15 +144,6 @@ pub const ino_t = u64; pub const dev_t = u64; pub const blkcnt_t = i64; -pub const Flock = extern struct { - type: i16, - whence: i16, - start: off_t, - len: off_t, - pid: pid_t, - __unused: [4]u8, -}; - // The `stat` definition used by the Linux kernel. pub const Stat = extern struct { dev: dev_t, diff --git a/lib/std/os/linux/riscv64.zig b/lib/std/os/linux/riscv64.zig index 6091c386ff..9c1d172ede 100644 --- a/lib/std/os/linux/riscv64.zig +++ b/lib/std/os/linux/riscv64.zig @@ -135,30 +135,6 @@ pub fn clone() callconv(.naked) u64 { ); } -pub const F = struct { - pub const DUPFD = 0; - pub const GETFD = 1; - pub const SETFD = 2; - pub const GETFL = 3; - pub const SETFL = 4; - pub const GETLK = 5; - pub const SETLK = 6; - pub const SETLKW = 7; - pub const SETOWN = 8; - pub const GETOWN = 9; - pub const SETSIG = 10; - pub const GETSIG = 11; - - pub const RDLCK = 0; - pub const WRLCK = 1; - pub const UNLCK = 2; - - pub const SETOWN_EX = 15; - pub const GETOWN_EX = 16; - - pub const GETOWNER_UIDS = 17; -}; - pub const blksize_t = i32; pub const nlink_t = u32; pub const time_t = i64; @@ -168,15 +144,6 @@ pub const ino_t = u64; pub const dev_t = u64; pub const blkcnt_t = i64; -pub const Flock = extern struct { - type: i16, - whence: i16, - start: off_t, - len: off_t, - pid: pid_t, - __unused: [4]u8, -}; - // The `stat` definition used by the Linux kernel. pub const Stat = extern struct { dev: dev_t, diff --git a/lib/std/os/linux/s390x.zig b/lib/std/os/linux/s390x.zig index fc1e79db85..c6b02946d1 100644 --- a/lib/std/os/linux/s390x.zig +++ b/lib/std/os/linux/s390x.zig @@ -157,26 +157,6 @@ pub fn restore_rt() callconv(.naked) noreturn { ); } -pub const F = struct { - pub const DUPFD = 0; - pub const GETFD = 1; - pub const SETFD = 2; - pub const GETFL = 3; - pub const SETFL = 4; - pub const GETLK = 5; - pub const SETLK = 6; - pub const SETLKW = 7; - pub const SETOWN = 8; - pub const GETOWN = 9; - pub const SETSIG = 10; - pub const GETSIG = 11; - - pub const SETOWN_EX = 15; - pub const GETOWN_EX = 16; - - pub const GETOWNER_UIDS = 17; -}; - pub const blksize_t = i64; pub const nlink_t = u64; pub const time_t = i64; @@ -186,14 +166,6 @@ pub const ino_t = u64; pub const dev_t = u64; pub const blkcnt_t = i64; -pub const Flock = extern struct { - type: i16, - whence: i16, - start: off_t, - len: off_t, - pid: pid_t, -}; - // The `stat` definition used by the Linux kernel. pub const Stat = extern struct { dev: dev_t, diff --git a/lib/std/os/linux/sparc64.zig b/lib/std/os/linux/sparc64.zig index 7365d85c76..bafb09ef44 100644 --- a/lib/std/os/linux/sparc64.zig +++ b/lib/std/os/linux/sparc64.zig @@ -236,42 +236,11 @@ pub fn restore_rt() callconv(.c) void { : .{ .memory = true, .icc = true, .o0 = true, .o1 = true, .o2 = true, .o3 = true, .o4 = true, .o5 = true, .o7 = true }); } -pub const F = struct { - pub const DUPFD = 0; - pub const GETFD = 1; - pub const SETFD = 2; - pub const GETFL = 3; - pub const SETFL = 4; - - pub const SETOWN = 5; - pub const GETOWN = 6; - pub const GETLK = 7; - pub const SETLK = 8; - pub const SETLKW = 9; - - pub const RDLCK = 1; - pub const WRLCK = 2; - pub const UNLCK = 3; - - pub const SETOWN_EX = 15; - pub const GETOWN_EX = 16; - - pub const GETOWNER_UIDS = 17; -}; - pub const VDSO = struct { pub const CGT_SYM = "__vdso_clock_gettime"; pub const CGT_VER = "LINUX_2.6"; }; -pub const Flock = extern struct { - type: i16, - whence: i16, - start: off_t, - len: off_t, - pid: pid_t, -}; - pub const off_t = i64; pub const ino_t = u64; pub const time_t = i64; diff --git a/lib/std/os/linux/x86.zig b/lib/std/os/linux/x86.zig index 4f72c3cc63..c2d921bf93 100644 --- a/lib/std/os/linux/x86.zig +++ b/lib/std/os/linux/x86.zig @@ -200,43 +200,11 @@ pub fn restore_rt() callconv(.naked) noreturn { } } -pub const F = struct { - pub const DUPFD = 0; - pub const GETFD = 1; - pub const SETFD = 2; - pub const GETFL = 3; - pub const SETFL = 4; - pub const SETOWN = 8; - pub const GETOWN = 9; - pub const SETSIG = 10; - pub const GETSIG = 11; - pub const GETLK = 12; - pub const SETLK = 13; - pub const SETLKW = 14; - pub const SETOWN_EX = 15; - pub const GETOWN_EX = 16; - pub const GETOWNER_UIDS = 17; - - pub const RDLCK = 0; - pub const WRLCK = 1; - pub const UNLCK = 2; -}; - pub const VDSO = struct { pub const CGT_SYM = "__vdso_clock_gettime"; pub const CGT_VER = "LINUX_2.6"; }; -pub const ARCH = struct {}; - -pub const Flock = extern struct { - type: i16, - whence: i16, - start: off_t, - len: off_t, - pid: pid_t, -}; - pub const blksize_t = i32; pub const nlink_t = u32; pub const time_t = i32; diff --git a/lib/std/os/linux/x86_64.zig b/lib/std/os/linux/x86_64.zig index 79381c8b58..05df72d991 100644 --- a/lib/std/os/linux/x86_64.zig +++ b/lib/std/os/linux/x86_64.zig @@ -151,29 +151,9 @@ pub const time_t = i64; pub const nlink_t = u64; pub const blksize_t = i64; pub const blkcnt_t = i64; - -pub const F = struct { - pub const DUPFD = 0; - pub const GETFD = 1; - pub const SETFD = 2; - pub const GETFL = 3; - pub const SETFL = 4; - pub const GETLK = 5; - pub const SETLK = 6; - pub const SETLKW = 7; - pub const SETOWN = 8; - pub const GETOWN = 9; - pub const SETSIG = 10; - pub const GETSIG = 11; - - pub const SETOWN_EX = 15; - pub const GETOWN_EX = 16; - pub const GETOWNER_UIDS = 17; - - pub const RDLCK = 0; - pub const WRLCK = 1; - pub const UNLCK = 2; -}; +pub const off_t = i64; +pub const ino_t = u64; +pub const dev_t = u64; pub const VDSO = struct { pub const CGT_SYM = "__vdso_clock_gettime"; @@ -190,18 +170,6 @@ pub const ARCH = struct { pub const GET_GS = 0x1004; }; -pub const Flock = extern struct { - type: i16, - whence: i16, - start: off_t, - len: off_t, - pid: pid_t, -}; - -pub const off_t = i64; -pub const ino_t = u64; -pub const dev_t = u64; - // The `stat` definition used by the Linux kernel. pub const Stat = extern struct { dev: dev_t,