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
signature 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(...@@ -88,8 +88,6 @@ pub fn clone(
88}88}
8989
90pub const ARCH = arch_bits.ARCH;90pub const ARCH = arch_bits.ARCH;
91pub const F = arch_bits.F;
92pub const Flock = arch_bits.Flock;
93pub const HWCAP = arch_bits.HWCAP;91pub const HWCAP = arch_bits.HWCAP;
94pub const SC = arch_bits.SC;92pub const SC = arch_bits.SC;
95pub const Stat = arch_bits.Stat;93pub const Stat = arch_bits.Stat;
...@@ -110,7 +108,7 @@ pub const IOCTL = @import("linux/ioctl.zig");...@@ -110,7 +108,7 @@ pub const IOCTL = @import("linux/ioctl.zig");
110pub const SECCOMP = @import("linux/seccomp.zig");108pub const SECCOMP = @import("linux/seccomp.zig");
111109
112pub const syscalls = @import("linux/syscalls.zig");110pub const syscalls = @import("linux/syscalls.zig");
113pub const SYS = switch (@import("builtin").cpu.arch) {111pub const SYS = switch (native_arch) {
114 .arc => syscalls.Arc,112 .arc => syscalls.Arc,
115 .arm, .armeb, .thumb, .thumbeb => syscalls.Arm,113 .arm, .armeb, .thumb, .thumbeb => syscalls.Arm,
116 .aarch64, .aarch64_be => syscalls.Arm64,114 .aarch64, .aarch64_be => syscalls.Arm64,
...@@ -1596,6 +1594,70 @@ pub fn waitid(id_type: P, id: i32, infop: *siginfo_t, flags: u32) usize {...@@ -1596,6 +1594,70 @@ pub fn waitid(id_type: P, id: i32, infop: *siginfo_t, flags: u32) usize {
1596 return syscall5(.waitid, @intFromEnum(id_type), @as(usize, @bitCast(@as(isize, id))), @intFromPtr(infop), flags, 0);1594 return syscall5(.waitid, @intFromEnum(id_type), @as(usize, @bitCast(@as(isize, id))), @intFromPtr(infop), flags, 0);
1597}1595}
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
1599pub fn fcntl(fd: fd_t, cmd: i32, arg: usize) usize {1661pub fn fcntl(fd: fd_t, cmd: i32, arg: usize) usize {
1600 if (@hasField(SYS, "fcntl64")) {1662 if (@hasField(SYS, "fcntl64")) {
1601 return syscall3(.fcntl64, @as(usize, @bitCast(@as(isize, fd))), @as(usize, @bitCast(@as(isize, cmd))), arg);1663 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 {...@@ -150,46 +150,11 @@ pub fn restore_rt() callconv(.naked) noreturn {
150 }150 }
151}151}
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
179pub const VDSO = struct {153pub const VDSO = struct {
180 pub const CGT_SYM = "__kernel_clock_gettime";154 pub const CGT_SYM = "__kernel_clock_gettime";
181 pub const CGT_VER = "LINUX_2.6.39";155 pub const CGT_VER = "LINUX_2.6.39";
182};156};
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
193pub const blksize_t = i32;158pub const blksize_t = i32;
194pub const nlink_t = u32;159pub const nlink_t = u32;
195pub const time_t = i64;160pub const time_t = i64;
lib/std/os/linux/arm.zig-36
...@@ -159,32 +159,6 @@ pub fn restore_rt() callconv(.naked) noreturn {...@@ -159,32 +159,6 @@ pub fn restore_rt() callconv(.naked) noreturn {
159 }159 }
160}160}
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
188pub const VDSO = struct {162pub const VDSO = struct {
189 pub const CGT_SYM = "__vdso_clock_gettime";163 pub const CGT_SYM = "__vdso_clock_gettime";
190 pub const CGT_VER = "LINUX_2.6";164 pub const CGT_VER = "LINUX_2.6";
...@@ -216,16 +190,6 @@ pub const HWCAP = struct {...@@ -216,16 +190,6 @@ pub const HWCAP = struct {
216 pub const EVTSTRM = 1 << 21;190 pub const EVTSTRM = 1 << 21;
217};191};
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
229pub const blksize_t = i32;193pub const blksize_t = i32;
230pub const nlink_t = u32;194pub const nlink_t = u32;
231pub const time_t = i32;195pub const time_t = i32;
lib/std/os/linux/hexagon.zig-33
...@@ -130,39 +130,6 @@ pub fn clone() callconv(.naked) u32 {...@@ -130,39 +130,6 @@ pub fn clone() callconv(.naked) u32 {
130 );130 );
131}131}
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
166pub const blksize_t = i32;133pub const blksize_t = i32;
167pub const nlink_t = u32;134pub const nlink_t = u32;
168pub const time_t = i32;135pub const time_t = i32;
lib/std/os/linux/loongarch64.zig-24
...@@ -176,30 +176,6 @@ pub const Stat = extern struct {...@@ -176,30 +176,6 @@ pub const Stat = extern struct {
176 }176 }
177};177};
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
203pub const VDSO = struct {179pub const VDSO = struct {
204 pub const CGT_SYM = "__vdso_clock_gettime";180 pub const CGT_SYM = "__vdso_clock_gettime";
205 pub const CGT_VER = "LINUX_5.10";181 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 {...@@ -151,32 +151,6 @@ pub fn restore_rt() callconv(.naked) noreturn {
151 );151 );
152}152}
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
180pub const blksize_t = i32;154pub const blksize_t = i32;
181pub const nlink_t = u32;155pub const nlink_t = u32;
182pub const time_t = i32;156pub const time_t = i32;
...@@ -186,14 +160,6 @@ pub const ino_t = u64;...@@ -186,14 +160,6 @@ pub const ino_t = u64;
186pub const dev_t = u64;160pub const dev_t = u64;
187pub const blkcnt_t = i64;161pub 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
197pub const Stat = extern struct {163pub const Stat = extern struct {
198 dev: dev_t,164 dev: dev_t,
199 __pad: i16,165 __pad: i16,
lib/std/os/linux/mips.zig-36
...@@ -243,47 +243,11 @@ pub fn clone() callconv(.naked) u32 {...@@ -243,47 +243,11 @@ pub fn clone() callconv(.naked) u32 {
243 );243 );
244}244}
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
272pub const VDSO = struct {246pub const VDSO = struct {
273 pub const CGT_SYM = "__vdso_clock_gettime";247 pub const CGT_SYM = "__vdso_clock_gettime";
274 pub const CGT_VER = "LINUX_2.6";248 pub const CGT_VER = "LINUX_2.6";
275};249};
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
287pub const blksize_t = u32;251pub const blksize_t = u32;
288pub const nlink_t = u32;252pub const nlink_t = u32;
289pub const time_t = i32;253pub const time_t = i32;
lib/std/os/linux/mips64.zig-36
...@@ -222,47 +222,11 @@ pub fn clone() callconv(.naked) u64 {...@@ -222,47 +222,11 @@ pub fn clone() callconv(.naked) u64 {
222 );222 );
223}223}
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
251pub const VDSO = struct {225pub const VDSO = struct {
252 pub const CGT_SYM = "__vdso_clock_gettime";226 pub const CGT_SYM = "__vdso_clock_gettime";
253 pub const CGT_VER = "LINUX_2.6";227 pub const CGT_VER = "LINUX_2.6";
254};228};
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
266pub const blksize_t = u32;230pub const blksize_t = u32;
267pub const nlink_t = u32;231pub const nlink_t = u32;
268pub const time_t = i32;232pub const time_t = i32;
lib/std/os/linux/powerpc.zig-34
...@@ -262,45 +262,11 @@ pub fn restore_rt() callconv(.naked) noreturn {...@@ -262,45 +262,11 @@ pub fn restore_rt() callconv(.naked) noreturn {
262 }262 }
263}263}
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
291pub const VDSO = struct {265pub const VDSO = struct {
292 pub const CGT_SYM = "__kernel_clock_gettime";266 pub const CGT_SYM = "__kernel_clock_gettime";
293 pub const CGT_VER = "LINUX_2.6.15";267 pub const CGT_VER = "LINUX_2.6.15";
294};268};
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
304pub const blksize_t = i32;270pub const blksize_t = i32;
305pub const nlink_t = u32;271pub const nlink_t = u32;
306pub const time_t = i32;272pub const time_t = i32;
lib/std/os/linux/powerpc64.zig-35
...@@ -247,46 +247,11 @@ pub fn restore_rt() callconv(.naked) noreturn {...@@ -247,46 +247,11 @@ pub fn restore_rt() callconv(.naked) noreturn {
247 }247 }
248}248}
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
276pub const VDSO = struct {250pub const VDSO = struct {
277 pub const CGT_SYM = "__kernel_clock_gettime";251 pub const CGT_SYM = "__kernel_clock_gettime";
278 pub const CGT_VER = "LINUX_2.6.15";252 pub const CGT_VER = "LINUX_2.6.15";
279};253};
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
290pub const blksize_t = i64;255pub const blksize_t = i64;
291pub const nlink_t = u64;256pub const nlink_t = u64;
292pub const time_t = i64;257pub const time_t = i64;
lib/std/os/linux/riscv32.zig-33
...@@ -135,30 +135,6 @@ pub fn clone() callconv(.naked) u32 {...@@ -135,30 +135,6 @@ pub fn clone() callconv(.naked) u32 {
135 );135 );
136}136}
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
162pub const blksize_t = i32;138pub const blksize_t = i32;
163pub const nlink_t = u32;139pub const nlink_t = u32;
164pub const time_t = i64;140pub const time_t = i64;
...@@ -168,15 +144,6 @@ pub const ino_t = u64;...@@ -168,15 +144,6 @@ pub const ino_t = u64;
168pub const dev_t = u64;144pub const dev_t = u64;
169pub const blkcnt_t = i64;145pub 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
180// The `stat` definition used by the Linux kernel.147// The `stat` definition used by the Linux kernel.
181pub const Stat = extern struct {148pub const Stat = extern struct {
182 dev: dev_t,149 dev: dev_t,
lib/std/os/linux/riscv64.zig-33
...@@ -135,30 +135,6 @@ pub fn clone() callconv(.naked) u64 {...@@ -135,30 +135,6 @@ pub fn clone() callconv(.naked) u64 {
135 );135 );
136}136}
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
162pub const blksize_t = i32;138pub const blksize_t = i32;
163pub const nlink_t = u32;139pub const nlink_t = u32;
164pub const time_t = i64;140pub const time_t = i64;
...@@ -168,15 +144,6 @@ pub const ino_t = u64;...@@ -168,15 +144,6 @@ pub const ino_t = u64;
168pub const dev_t = u64;144pub const dev_t = u64;
169pub const blkcnt_t = i64;145pub 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
180// The `stat` definition used by the Linux kernel.147// The `stat` definition used by the Linux kernel.
181pub const Stat = extern struct {148pub const Stat = extern struct {
182 dev: dev_t,149 dev: dev_t,
lib/std/os/linux/s390x.zig-28
...@@ -157,26 +157,6 @@ pub fn restore_rt() callconv(.naked) noreturn {...@@ -157,26 +157,6 @@ pub fn restore_rt() callconv(.naked) noreturn {
157 );157 );
158}158}
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
180pub const blksize_t = i64;160pub const blksize_t = i64;
181pub const nlink_t = u64;161pub const nlink_t = u64;
182pub const time_t = i64;162pub const time_t = i64;
...@@ -186,14 +166,6 @@ pub const ino_t = u64;...@@ -186,14 +166,6 @@ pub const ino_t = u64;
186pub const dev_t = u64;166pub const dev_t = u64;
187pub const blkcnt_t = i64;167pub 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
197// The `stat` definition used by the Linux kernel.169// The `stat` definition used by the Linux kernel.
198pub const Stat = extern struct {170pub const Stat = extern struct {
199 dev: dev_t,171 dev: dev_t,
lib/std/os/linux/sparc64.zig-31
...@@ -236,42 +236,11 @@ pub fn restore_rt() callconv(.c) void {...@@ -236,42 +236,11 @@ pub fn restore_rt() callconv(.c) void {
236 : .{ .memory = true, .icc = true, .o0 = true, .o1 = true, .o2 = true, .o3 = true, .o4 = true, .o5 = true, .o7 = true });236 : .{ .memory = true, .icc = true, .o0 = true, .o1 = true, .o2 = true, .o3 = true, .o4 = true, .o5 = true, .o7 = true });
237}237}
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
262pub const VDSO = struct {239pub const VDSO = struct {
263 pub const CGT_SYM = "__vdso_clock_gettime";240 pub const CGT_SYM = "__vdso_clock_gettime";
264 pub const CGT_VER = "LINUX_2.6";241 pub const CGT_VER = "LINUX_2.6";
265};242};
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
275pub const off_t = i64;244pub const off_t = i64;
276pub const ino_t = u64;245pub const ino_t = u64;
277pub const time_t = i64;246pub const time_t = i64;
lib/std/os/linux/x86.zig-32
...@@ -200,43 +200,11 @@ pub fn restore_rt() callconv(.naked) noreturn {...@@ -200,43 +200,11 @@ pub fn restore_rt() callconv(.naked) noreturn {
200 }200 }
201}201}
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
225pub const VDSO = struct {203pub const VDSO = struct {
226 pub const CGT_SYM = "__vdso_clock_gettime";204 pub const CGT_SYM = "__vdso_clock_gettime";
227 pub const CGT_VER = "LINUX_2.6";205 pub const CGT_VER = "LINUX_2.6";
228};206};
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
240pub const blksize_t = i32;208pub const blksize_t = i32;
241pub const nlink_t = u32;209pub const nlink_t = u32;
242pub const time_t = i32;210pub const time_t = i32;
lib/std/os/linux/x86_64.zig+3-35
...@@ -151,29 +151,9 @@ pub const time_t = i64;...@@ -151,29 +151,9 @@ pub const time_t = i64;
151pub const nlink_t = u64;151pub const nlink_t = u64;
152pub const blksize_t = i64;152pub const blksize_t = i64;
153pub const blkcnt_t = i64;153pub const blkcnt_t = i64;
154154pub const off_t = i64;
155pub const F = struct {155pub const ino_t = u64;
156 pub const DUPFD = 0;156pub const dev_t = u64;
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};
177157
178pub const VDSO = struct {158pub const VDSO = struct {
179 pub const CGT_SYM = "__vdso_clock_gettime";159 pub const CGT_SYM = "__vdso_clock_gettime";
...@@ -190,18 +170,6 @@ pub const ARCH = struct {...@@ -190,18 +170,6 @@ pub const ARCH = struct {
190 pub const GET_GS = 0x1004;170 pub const GET_GS = 0x1004;
191};171};
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
205// The `stat` definition used by the Linux kernel.173// The `stat` definition used by the Linux kernel.
206pub const Stat = extern struct {174pub const Stat = extern struct {
207 dev: dev_t,175 dev: dev_t,