authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-17 00:36:16+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-17 01:20:33+02:00
logdc1bc52dd6c10b99041f9e6189d6fd3541c714c4
tree072521f6af0b575a555d93492876a1ebdb948366
parentcfdc0f0e34b00a7e1a4dc23f1d6672f213bbf9ca
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

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.

16 files changed, 68 insertions(+), 498 deletions(-)

lib/std/os/linux.zig+65-3
......@@ -88,8 +88,6 @@ pub fn clone(
8888}
8989
9090pub const ARCH = arch_bits.ARCH;
91pub const F = arch_bits.F;
92pub const Flock = arch_bits.Flock;
9391pub const HWCAP = arch_bits.HWCAP;
9492pub const SC = arch_bits.SC;
9593pub const Stat = arch_bits.Stat;
......@@ -110,7 +108,7 @@ pub const IOCTL = @import("linux/ioctl.zig");
110108pub const SECCOMP = @import("linux/seccomp.zig");
111109
112110pub const syscalls = @import("linux/syscalls.zig");
113pub const SYS = switch (@import("builtin").cpu.arch) {
111pub const SYS = switch (native_arch) {
114112 .arc => syscalls.Arc,
115113 .arm, .armeb, .thumb, .thumbeb => syscalls.Arm,
116114 .aarch64, .aarch64_be => syscalls.Arm64,
......@@ -1596,6 +1594,70 @@ pub fn waitid(id_type: P, id: i32, infop: *siginfo_t, flags: u32) usize {
15961594 return syscall5(.waitid, @intFromEnum(id_type), @as(usize, @bitCast(@as(isize, id))), @intFromPtr(infop), flags, 0);
15971595}
15981596
1597pub const F = struct {
1598 pub const DUPFD = 0;
1599 pub const GETFD = 1;
1600 pub const SETFD = 2;
1601 pub const GETFL = 3;
1602 pub const SETFL = 4;
1603
1604 pub const GETLK = GET_SET_LK.GETLK;
1605 pub const SETLK = GET_SET_LK.SETLK;
1606 pub const SETLKW = GET_SET_LK.SETLKW;
1607
1608 const GET_SET_LK = if (@sizeOf(usize) == 64) extern struct {
1609 pub const GETLK = if (is_mips) 14 else if (is_sparc) 7 else 5;
1610 pub const SETLK = if (is_mips) 6 else if (is_sparc) 8 else 6;
1611 pub const SETLKW = if (is_mips) 7 else if (is_sparc) 9 else 7;
1612 } else extern struct {
1613 // Ensure that 32-bit code uses the large-file variants (GETLK64, etc).
1614
1615 pub const GETLK = if (is_mips) 33 else 12;
1616 pub const SETLK = if (is_mips) 34 else 13;
1617 pub const SETLKW = if (is_mips) 35 else 14;
1618 };
1619
1620 pub const SETOWN = if (is_mips) 24 else if (is_sparc) 6 else 8;
1621 pub const GETOWN = if (is_mips) 23 else if (is_sparc) 5 else 9;
1622
1623 pub const SETSIG = 10;
1624 pub const GETSIG = 11;
1625
1626 pub const SETOWN_EX = 15;
1627 pub const GETOWN_EX = 16;
1628
1629 pub const GETOWNER_UIDS = 17;
1630
1631 pub const OFD_GETLK = 36;
1632 pub const OFD_SETLK = 37;
1633 pub const OFD_SETLKW = 38;
1634
1635 pub const RDLCK = if (is_sparc) 1 else 0;
1636 pub const WRLCK = if (is_sparc) 2 else 1;
1637 pub const UNLCK = if (is_sparc) 3 else 2;
1638};
1639
1640pub const F_OWNER = enum(i32) {
1641 TID = 0,
1642 PID = 1,
1643 PGRP = 2,
1644 _,
1645};
1646
1647pub const f_owner_ex = extern struct {
1648 type: F_OWNER,
1649 pid: pid_t,
1650};
1651
1652pub const Flock = extern struct {
1653 type: i16,
1654 whence: i16,
1655 start: off_t,
1656 len: off_t,
1657 pid: pid_t,
1658 _unused: if (is_sparc) i16 else void,
1659};
1660
15991661pub fn fcntl(fd: fd_t, cmd: i32, arg: usize) usize {
16001662 if (@hasField(SYS, "fcntl64")) {
16011663 return syscall3(.fcntl64, @as(usize, @bitCast(@as(isize, fd))), @as(usize, @bitCast(@as(isize, cmd))), arg);
lib/std/os/linux/aarch64.zig-35
......@@ -150,46 +150,11 @@ pub fn restore_rt() callconv(.naked) noreturn {
150150 }
151151}
152152
153pub const F = struct {
154 pub const DUPFD = 0;
155 pub const GETFD = 1;
156 pub const SETFD = 2;
157 pub const GETFL = 3;
158 pub const SETFL = 4;
159
160 pub const SETOWN = 8;
161 pub const GETOWN = 9;
162 pub const SETSIG = 10;
163 pub const GETSIG = 11;
164
165 pub const GETLK = 5;
166 pub const SETLK = 6;
167 pub const SETLKW = 7;
168
169 pub const RDLCK = 0;
170 pub const WRLCK = 1;
171 pub const UNLCK = 2;
172
173 pub const SETOWN_EX = 15;
174 pub const GETOWN_EX = 16;
175
176 pub const GETOWNER_UIDS = 17;
177};
178
179153pub const VDSO = struct {
180154 pub const CGT_SYM = "__kernel_clock_gettime";
181155 pub const CGT_VER = "LINUX_2.6.39";
182156};
183157
184pub const Flock = extern struct {
185 type: i16,
186 whence: i16,
187 start: off_t,
188 len: off_t,
189 pid: pid_t,
190 __unused: [4]u8,
191};
192
193158pub const blksize_t = i32;
194159pub const nlink_t = u32;
195160pub const time_t = i64;
lib/std/os/linux/arm.zig-36
......@@ -159,32 +159,6 @@ pub fn restore_rt() callconv(.naked) noreturn {
159159 }
160160}
161161
162pub const F = struct {
163 pub const DUPFD = 0;
164 pub const GETFD = 1;
165 pub const SETFD = 2;
166 pub const GETFL = 3;
167 pub const SETFL = 4;
168
169 pub const SETOWN = 8;
170 pub const GETOWN = 9;
171 pub const SETSIG = 10;
172 pub const GETSIG = 11;
173
174 pub const GETLK = 12;
175 pub const SETLK = 13;
176 pub const SETLKW = 14;
177
178 pub const RDLCK = 0;
179 pub const WRLCK = 1;
180 pub const UNLCK = 2;
181
182 pub const SETOWN_EX = 15;
183 pub const GETOWN_EX = 16;
184
185 pub const GETOWNER_UIDS = 17;
186};
187
188162pub const VDSO = struct {
189163 pub const CGT_SYM = "__vdso_clock_gettime";
190164 pub const CGT_VER = "LINUX_2.6";
......@@ -216,16 +190,6 @@ pub const HWCAP = struct {
216190 pub const EVTSTRM = 1 << 21;
217191};
218192
219pub const Flock = extern struct {
220 type: i16,
221 whence: i16,
222 __pad0: [4]u8,
223 start: off_t,
224 len: off_t,
225 pid: pid_t,
226 __unused: [4]u8,
227};
228
229193pub const blksize_t = i32;
230194pub const nlink_t = u32;
231195pub const time_t = i32;
lib/std/os/linux/hexagon.zig-33
......@@ -130,39 +130,6 @@ pub fn clone() callconv(.naked) u32 {
130130 );
131131}
132132
133pub const F = struct {
134 pub const DUPFD = 0;
135 pub const GETFD = 1;
136 pub const SETFD = 2;
137 pub const GETFL = 3;
138 pub const SETFL = 4;
139 pub const GETLK = 5;
140 pub const SETLK = 6;
141 pub const SETLKW = 7;
142 pub const SETOWN = 8;
143 pub const GETOWN = 9;
144 pub const SETSIG = 10;
145 pub const GETSIG = 11;
146
147 pub const RDLCK = 0;
148 pub const WRLCK = 1;
149 pub const UNLCK = 2;
150
151 pub const SETOWN_EX = 15;
152 pub const GETOWN_EX = 16;
153
154 pub const GETOWNER_UIDS = 17;
155};
156
157pub const Flock = extern struct {
158 type: i16,
159 whence: i16,
160 start: off_t,
161 len: off_t,
162 pid: pid_t,
163 __unused: [4]u8,
164};
165
166133pub const blksize_t = i32;
167134pub const nlink_t = u32;
168135pub const time_t = i32;
lib/std/os/linux/loongarch64.zig-24
......@@ -176,30 +176,6 @@ pub const Stat = extern struct {
176176 }
177177};
178178
179pub const F = struct {
180 pub const DUPFD = 0;
181 pub const GETFD = 1;
182 pub const SETFD = 2;
183 pub const GETFL = 3;
184 pub const SETFL = 4;
185 pub const GETLK = 5;
186 pub const SETLK = 6;
187 pub const SETLKW = 7;
188 pub const SETOWN = 8;
189 pub const GETOWN = 9;
190 pub const SETSIG = 10;
191 pub const GETSIG = 11;
192
193 pub const RDLCK = 0;
194 pub const WRLCK = 1;
195 pub const UNLCK = 2;
196
197 pub const SETOWN_EX = 15;
198 pub const GETOWN_EX = 16;
199
200 pub const GETOWNER_UIDS = 17;
201};
202
203179pub const VDSO = struct {
204180 pub const CGT_SYM = "__vdso_clock_gettime";
205181 pub const CGT_VER = "LINUX_5.10";
lib/std/os/linux/m68k.zig-34
......@@ -151,32 +151,6 @@ pub fn restore_rt() callconv(.naked) noreturn {
151151 );
152152}
153153
154pub const F = struct {
155 pub const DUPFD = 0;
156 pub const GETFD = 1;
157 pub const SETFD = 2;
158 pub const GETFL = 3;
159 pub const SETFL = 4;
160
161 pub const SETOWN = 8;
162 pub const GETOWN = 9;
163 pub const SETSIG = 10;
164 pub const GETSIG = 11;
165
166 pub const GETLK = 12;
167 pub const SETLK = 13;
168 pub const SETLKW = 14;
169
170 pub const SETOWN_EX = 15;
171 pub const GETOWN_EX = 16;
172
173 pub const GETOWNER_UIDS = 17;
174
175 pub const RDLCK = 0;
176 pub const WRLCK = 1;
177 pub const UNLCK = 2;
178};
179
180154pub const blksize_t = i32;
181155pub const nlink_t = u32;
182156pub const time_t = i32;
......@@ -186,14 +160,6 @@ pub const ino_t = u64;
186160pub const dev_t = u64;
187161pub const blkcnt_t = i64;
188162
189pub const Flock = extern struct {
190 type: i16,
191 whence: i16,
192 start: off_t,
193 len: off_t,
194 pid: pid_t,
195};
196
197163pub const Stat = extern struct {
198164 dev: dev_t,
199165 __pad: i16,
lib/std/os/linux/mips.zig-36
......@@ -243,47 +243,11 @@ pub fn clone() callconv(.naked) u32 {
243243 );
244244}
245245
246pub const F = struct {
247 pub const DUPFD = 0;
248 pub const GETFD = 1;
249 pub const SETFD = 2;
250 pub const GETFL = 3;
251 pub const SETFL = 4;
252
253 pub const SETOWN = 24;
254 pub const GETOWN = 23;
255 pub const SETSIG = 10;
256 pub const GETSIG = 11;
257
258 pub const GETLK = 33;
259 pub const SETLK = 34;
260 pub const SETLKW = 35;
261
262 pub const RDLCK = 0;
263 pub const WRLCK = 1;
264 pub const UNLCK = 2;
265
266 pub const SETOWN_EX = 15;
267 pub const GETOWN_EX = 16;
268
269 pub const GETOWNER_UIDS = 17;
270};
271
272246pub const VDSO = struct {
273247 pub const CGT_SYM = "__vdso_clock_gettime";
274248 pub const CGT_VER = "LINUX_2.6";
275249};
276250
277pub const Flock = extern struct {
278 type: i16,
279 whence: i16,
280 __pad0: [4]u8,
281 start: off_t,
282 len: off_t,
283 pid: pid_t,
284 __unused: [4]u8,
285};
286
287251pub const blksize_t = u32;
288252pub const nlink_t = u32;
289253pub const time_t = i32;
lib/std/os/linux/mips64.zig-36
......@@ -222,47 +222,11 @@ pub fn clone() callconv(.naked) u64 {
222222 );
223223}
224224
225pub const F = struct {
226 pub const DUPFD = 0;
227 pub const GETFD = 1;
228 pub const SETFD = 2;
229 pub const GETFL = 3;
230 pub const SETFL = 4;
231
232 pub const SETOWN = 24;
233 pub const GETOWN = 23;
234 pub const SETSIG = 10;
235 pub const GETSIG = 11;
236
237 pub const GETLK = 33;
238 pub const SETLK = 34;
239 pub const SETLKW = 35;
240
241 pub const RDLCK = 0;
242 pub const WRLCK = 1;
243 pub const UNLCK = 2;
244
245 pub const SETOWN_EX = 15;
246 pub const GETOWN_EX = 16;
247
248 pub const GETOWNER_UIDS = 17;
249};
250
251225pub const VDSO = struct {
252226 pub const CGT_SYM = "__vdso_clock_gettime";
253227 pub const CGT_VER = "LINUX_2.6";
254228};
255229
256pub const Flock = extern struct {
257 type: i16,
258 whence: i16,
259 __pad0: [4]u8,
260 start: off_t,
261 len: off_t,
262 pid: pid_t,
263 __unused: [4]u8,
264};
265
266230pub const blksize_t = u32;
267231pub const nlink_t = u32;
268232pub const time_t = i32;
lib/std/os/linux/powerpc.zig-34
......@@ -262,45 +262,11 @@ pub fn restore_rt() callconv(.naked) noreturn {
262262 }
263263}
264264
265pub const F = struct {
266 pub const DUPFD = 0;
267 pub const GETFD = 1;
268 pub const SETFD = 2;
269 pub const GETFL = 3;
270 pub const SETFL = 4;
271
272 pub const SETOWN = 8;
273 pub const GETOWN = 9;
274 pub const SETSIG = 10;
275 pub const GETSIG = 11;
276
277 pub const GETLK = 12;
278 pub const SETLK = 13;
279 pub const SETLKW = 14;
280
281 pub const SETOWN_EX = 15;
282 pub const GETOWN_EX = 16;
283
284 pub const GETOWNER_UIDS = 17;
285
286 pub const RDLCK = 0;
287 pub const WRLCK = 1;
288 pub const UNLCK = 2;
289};
290
291265pub const VDSO = struct {
292266 pub const CGT_SYM = "__kernel_clock_gettime";
293267 pub const CGT_VER = "LINUX_2.6.15";
294268};
295269
296pub const Flock = extern struct {
297 type: i16,
298 whence: i16,
299 start: off_t,
300 len: off_t,
301 pid: pid_t,
302};
303
304270pub const blksize_t = i32;
305271pub const nlink_t = u32;
306272pub const time_t = i32;
lib/std/os/linux/powerpc64.zig-35
......@@ -247,46 +247,11 @@ pub fn restore_rt() callconv(.naked) noreturn {
247247 }
248248}
249249
250pub const F = struct {
251 pub const DUPFD = 0;
252 pub const GETFD = 1;
253 pub const SETFD = 2;
254 pub const GETFL = 3;
255 pub const SETFL = 4;
256
257 pub const SETOWN = 8;
258 pub const GETOWN = 9;
259 pub const SETSIG = 10;
260 pub const GETSIG = 11;
261
262 pub const GETLK = 5;
263 pub const SETLK = 6;
264 pub const SETLKW = 7;
265
266 pub const RDLCK = 0;
267 pub const WRLCK = 1;
268 pub const UNLCK = 2;
269
270 pub const SETOWN_EX = 15;
271 pub const GETOWN_EX = 16;
272
273 pub const GETOWNER_UIDS = 17;
274};
275
276250pub const VDSO = struct {
277251 pub const CGT_SYM = "__kernel_clock_gettime";
278252 pub const CGT_VER = "LINUX_2.6.15";
279253};
280254
281pub const Flock = extern struct {
282 type: i16,
283 whence: i16,
284 start: off_t,
285 len: off_t,
286 pid: pid_t,
287 __unused: [4]u8,
288};
289
290255pub const blksize_t = i64;
291256pub const nlink_t = u64;
292257pub const time_t = i64;
lib/std/os/linux/riscv32.zig-33
......@@ -135,30 +135,6 @@ pub fn clone() callconv(.naked) u32 {
135135 );
136136}
137137
138pub const F = struct {
139 pub const DUPFD = 0;
140 pub const GETFD = 1;
141 pub const SETFD = 2;
142 pub const GETFL = 3;
143 pub const SETFL = 4;
144 pub const GETLK = 5;
145 pub const SETLK = 6;
146 pub const SETLKW = 7;
147 pub const SETOWN = 8;
148 pub const GETOWN = 9;
149 pub const SETSIG = 10;
150 pub const GETSIG = 11;
151
152 pub const RDLCK = 0;
153 pub const WRLCK = 1;
154 pub const UNLCK = 2;
155
156 pub const SETOWN_EX = 15;
157 pub const GETOWN_EX = 16;
158
159 pub const GETOWNER_UIDS = 17;
160};
161
162138pub const blksize_t = i32;
163139pub const nlink_t = u32;
164140pub const time_t = i64;
......@@ -168,15 +144,6 @@ pub const ino_t = u64;
168144pub const dev_t = u64;
169145pub const blkcnt_t = i64;
170146
171pub const Flock = extern struct {
172 type: i16,
173 whence: i16,
174 start: off_t,
175 len: off_t,
176 pid: pid_t,
177 __unused: [4]u8,
178};
179
180147// The `stat` definition used by the Linux kernel.
181148pub const Stat = extern struct {
182149 dev: dev_t,
lib/std/os/linux/riscv64.zig-33
......@@ -135,30 +135,6 @@ pub fn clone() callconv(.naked) u64 {
135135 );
136136}
137137
138pub const F = struct {
139 pub const DUPFD = 0;
140 pub const GETFD = 1;
141 pub const SETFD = 2;
142 pub const GETFL = 3;
143 pub const SETFL = 4;
144 pub const GETLK = 5;
145 pub const SETLK = 6;
146 pub const SETLKW = 7;
147 pub const SETOWN = 8;
148 pub const GETOWN = 9;
149 pub const SETSIG = 10;
150 pub const GETSIG = 11;
151
152 pub const RDLCK = 0;
153 pub const WRLCK = 1;
154 pub const UNLCK = 2;
155
156 pub const SETOWN_EX = 15;
157 pub const GETOWN_EX = 16;
158
159 pub const GETOWNER_UIDS = 17;
160};
161
162138pub const blksize_t = i32;
163139pub const nlink_t = u32;
164140pub const time_t = i64;
......@@ -168,15 +144,6 @@ pub const ino_t = u64;
168144pub const dev_t = u64;
169145pub const blkcnt_t = i64;
170146
171pub const Flock = extern struct {
172 type: i16,
173 whence: i16,
174 start: off_t,
175 len: off_t,
176 pid: pid_t,
177 __unused: [4]u8,
178};
179
180147// The `stat` definition used by the Linux kernel.
181148pub const Stat = extern struct {
182149 dev: dev_t,
lib/std/os/linux/s390x.zig-28
......@@ -157,26 +157,6 @@ pub fn restore_rt() callconv(.naked) noreturn {
157157 );
158158}
159159
160pub const F = struct {
161 pub const DUPFD = 0;
162 pub const GETFD = 1;
163 pub const SETFD = 2;
164 pub const GETFL = 3;
165 pub const SETFL = 4;
166 pub const GETLK = 5;
167 pub const SETLK = 6;
168 pub const SETLKW = 7;
169 pub const SETOWN = 8;
170 pub const GETOWN = 9;
171 pub const SETSIG = 10;
172 pub const GETSIG = 11;
173
174 pub const SETOWN_EX = 15;
175 pub const GETOWN_EX = 16;
176
177 pub const GETOWNER_UIDS = 17;
178};
179
180160pub const blksize_t = i64;
181161pub const nlink_t = u64;
182162pub const time_t = i64;
......@@ -186,14 +166,6 @@ pub const ino_t = u64;
186166pub const dev_t = u64;
187167pub const blkcnt_t = i64;
188168
189pub const Flock = extern struct {
190 type: i16,
191 whence: i16,
192 start: off_t,
193 len: off_t,
194 pid: pid_t,
195};
196
197169// The `stat` definition used by the Linux kernel.
198170pub const Stat = extern struct {
199171 dev: dev_t,
lib/std/os/linux/sparc64.zig-31
......@@ -236,42 +236,11 @@ pub fn restore_rt() callconv(.c) void {
236236 : .{ .memory = true, .icc = true, .o0 = true, .o1 = true, .o2 = true, .o3 = true, .o4 = true, .o5 = true, .o7 = true });
237237}
238238
239pub const F = struct {
240 pub const DUPFD = 0;
241 pub const GETFD = 1;
242 pub const SETFD = 2;
243 pub const GETFL = 3;
244 pub const SETFL = 4;
245
246 pub const SETOWN = 5;
247 pub const GETOWN = 6;
248 pub const GETLK = 7;
249 pub const SETLK = 8;
250 pub const SETLKW = 9;
251
252 pub const RDLCK = 1;
253 pub const WRLCK = 2;
254 pub const UNLCK = 3;
255
256 pub const SETOWN_EX = 15;
257 pub const GETOWN_EX = 16;
258
259 pub const GETOWNER_UIDS = 17;
260};
261
262239pub const VDSO = struct {
263240 pub const CGT_SYM = "__vdso_clock_gettime";
264241 pub const CGT_VER = "LINUX_2.6";
265242};
266243
267pub const Flock = extern struct {
268 type: i16,
269 whence: i16,
270 start: off_t,
271 len: off_t,
272 pid: pid_t,
273};
274
275244pub const off_t = i64;
276245pub const ino_t = u64;
277246pub const time_t = i64;
lib/std/os/linux/x86.zig-32
......@@ -200,43 +200,11 @@ pub fn restore_rt() callconv(.naked) noreturn {
200200 }
201201}
202202
203pub const F = struct {
204 pub const DUPFD = 0;
205 pub const GETFD = 1;
206 pub const SETFD = 2;
207 pub const GETFL = 3;
208 pub const SETFL = 4;
209 pub const SETOWN = 8;
210 pub const GETOWN = 9;
211 pub const SETSIG = 10;
212 pub const GETSIG = 11;
213 pub const GETLK = 12;
214 pub const SETLK = 13;
215 pub const SETLKW = 14;
216 pub const SETOWN_EX = 15;
217 pub const GETOWN_EX = 16;
218 pub const GETOWNER_UIDS = 17;
219
220 pub const RDLCK = 0;
221 pub const WRLCK = 1;
222 pub const UNLCK = 2;
223};
224
225203pub const VDSO = struct {
226204 pub const CGT_SYM = "__vdso_clock_gettime";
227205 pub const CGT_VER = "LINUX_2.6";
228206};
229207
230pub const ARCH = struct {};
231
232pub const Flock = extern struct {
233 type: i16,
234 whence: i16,
235 start: off_t,
236 len: off_t,
237 pid: pid_t,
238};
239
240208pub const blksize_t = i32;
241209pub const nlink_t = u32;
242210pub const time_t = i32;
lib/std/os/linux/x86_64.zig+3-35
......@@ -151,29 +151,9 @@ pub const time_t = i64;
151151pub const nlink_t = u64;
152152pub const blksize_t = i64;
153153pub const blkcnt_t = i64;
154
155pub const F = struct {
156 pub const DUPFD = 0;
157 pub const GETFD = 1;
158 pub const SETFD = 2;
159 pub const GETFL = 3;
160 pub const SETFL = 4;
161 pub const GETLK = 5;
162 pub const SETLK = 6;
163 pub const SETLKW = 7;
164 pub const SETOWN = 8;
165 pub const GETOWN = 9;
166 pub const SETSIG = 10;
167 pub const GETSIG = 11;
168
169 pub const SETOWN_EX = 15;
170 pub const GETOWN_EX = 16;
171 pub const GETOWNER_UIDS = 17;
172
173 pub const RDLCK = 0;
174 pub const WRLCK = 1;
175 pub const UNLCK = 2;
176};
154pub const off_t = i64;
155pub const ino_t = u64;
156pub const dev_t = u64;
177157
178158pub const VDSO = struct {
179159 pub const CGT_SYM = "__vdso_clock_gettime";
......@@ -190,18 +170,6 @@ pub const ARCH = struct {
190170 pub const GET_GS = 0x1004;
191171};
192172
193pub const Flock = extern struct {
194 type: i16,
195 whence: i16,
196 start: off_t,
197 len: off_t,
198 pid: pid_t,
199};
200
201pub const off_t = i64;
202pub const ino_t = u64;
203pub const dev_t = u64;
204
205173// The `stat` definition used by the Linux kernel.
206174pub const Stat = extern struct {
207175 dev: dev_t,