authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-08-31 18:24:59-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-09-01 17:54:07-07:00
logf8dd4b13d6fe428265229fc1e31c2f8b0cd373b1
treeee97556c506b09e566b8d0db2329e9556fb5a768
parent057f0fec33c4e54e87383d1181e946d3cddbc4c0

std.os reorg: more fixes caught by CI


11 files changed, 244 insertions(+), 222 deletions(-)

lib/std/Thread.zig+1-1
......@@ -558,7 +558,7 @@ const PosixThreadImpl = struct {
558558 .openbsd => {
559559 var count: c_int = undefined;
560560 var count_size: usize = @sizeOf(c_int);
561 const mib = [_]c_int{ os.CTL_HW, os.HW_NCPUONLINE };
561 const mib = [_]c_int{ os.CTL.HW, os.HW_NCPUONLINE };
562562 os.sysctl(&mib, &count, &count_size, null, 0) catch |err| switch (err) {
563563 error.NameTooLong, error.UnknownName => unreachable,
564564 else => |e| return e,
lib/std/c/dragonfly.zig+68-64
......@@ -221,7 +221,7 @@ pub const SA = struct {
221221};
222222
223223pub const PATH_MAX = 1024;
224pub const IOV_MAX = KERN_IOV_MAX;
224pub const IOV_MAX = KERN.IOV_MAX;
225225
226226pub const ino_t = c_ulong;
227227
......@@ -270,69 +270,73 @@ pub const timeval = extern struct {
270270 tv_usec: suseconds_t,
271271};
272272
273pub const CTL_UNSPEC = 0;
274pub const CTL_KERN = 1;
275pub const CTL_VM = 2;
276pub const CTL_VFS = 3;
277pub const CTL_NET = 4;
278pub const CTL_DEBUG = 5;
279pub const CTL_HW = 6;
280pub const CTL_MACHDEP = 7;
281pub const CTL_USER = 8;
282pub const CTL_LWKT = 10;
283pub const CTL_MAXID = 11;
284pub const CTL_MAXNAME = 12;
285
286pub const KERN_PROC_ALL = 0;
287pub const KERN_OSTYPE = 1;
288pub const KERN_PROC_PID = 1;
289pub const KERN_OSRELEASE = 2;
290pub const KERN_PROC_PGRP = 2;
291pub const KERN_OSREV = 3;
292pub const KERN_PROC_SESSION = 3;
293pub const KERN_VERSION = 4;
294pub const KERN_PROC_TTY = 4;
295pub const KERN_MAXVNODES = 5;
296pub const KERN_PROC_UID = 5;
297pub const KERN_MAXPROC = 6;
298pub const KERN_PROC_RUID = 6;
299pub const KERN_MAXFILES = 7;
300pub const KERN_PROC_ARGS = 7;
301pub const KERN_ARGMAX = 8;
302pub const KERN_PROC_CWD = 8;
303pub const KERN_PROC_PATHNAME = 9;
304pub const KERN_SECURELVL = 9;
305pub const KERN_PROC_SIGTRAMP = 10;
306pub const KERN_HOSTNAME = 10;
307pub const KERN_HOSTID = 11;
308pub const KERN_CLOCKRATE = 12;
309pub const KERN_VNODE = 13;
310pub const KERN_PROC = 14;
311pub const KERN_FILE = 15;
312pub const KERN_PROC_FLAGMASK = 16;
313pub const KERN_PROF = 16;
314pub const KERN_PROC_FLAG_LWP = 16;
315pub const KERN_POSIX1 = 17;
316pub const KERN_NGROUPS = 18;
317pub const KERN_JOB_CONTROL = 19;
318pub const KERN_SAVED_IDS = 20;
319pub const KERN_BOOTTIME = 21;
320pub const KERN_NISDOMAINNAME = 22;
321pub const KERN_UPDATEINTERVAL = 23;
322pub const KERN_OSRELDATE = 24;
323pub const KERN_NTP_PLL = 25;
324pub const KERN_BOOTFILE = 26;
325pub const KERN_MAXFILESPERPROC = 27;
326pub const KERN_MAXPROCPERUID = 28;
327pub const KERN_DUMPDEV = 29;
328pub const KERN_IPC = 30;
329pub const KERN_DUMMY = 31;
330pub const KERN_PS_STRINGS = 32;
331pub const KERN_USRSTACK = 33;
332pub const KERN_LOGSIGEXIT = 34;
333pub const KERN_IOV_MAX = 35;
334pub const KERN_MAXPOSIXLOCKSPERUID = 36;
335pub const KERN_MAXID = 37;
273pub const CTL = struct {
274 pub const UNSPEC = 0;
275 pub const KERN = 1;
276 pub const VM = 2;
277 pub const VFS = 3;
278 pub const NET = 4;
279 pub const DEBUG = 5;
280 pub const HW = 6;
281 pub const MACHDEP = 7;
282 pub const USER = 8;
283 pub const LWKT = 10;
284 pub const MAXID = 11;
285 pub const MAXNAME = 12;
286};
287
288pub const KERN = struct {
289 pub const PROC_ALL = 0;
290 pub const OSTYPE = 1;
291 pub const PROC_PID = 1;
292 pub const OSRELEASE = 2;
293 pub const PROC_PGRP = 2;
294 pub const OSREV = 3;
295 pub const PROC_SESSION = 3;
296 pub const VERSION = 4;
297 pub const PROC_TTY = 4;
298 pub const MAXVNODES = 5;
299 pub const PROC_UID = 5;
300 pub const MAXPROC = 6;
301 pub const PROC_RUID = 6;
302 pub const MAXFILES = 7;
303 pub const PROC_ARGS = 7;
304 pub const ARGMAX = 8;
305 pub const PROC_CWD = 8;
306 pub const PROC_PATHNAME = 9;
307 pub const SECURELVL = 9;
308 pub const PROC_SIGTRAMP = 10;
309 pub const HOSTNAME = 10;
310 pub const HOSTID = 11;
311 pub const CLOCKRATE = 12;
312 pub const VNODE = 13;
313 pub const PROC = 14;
314 pub const FILE = 15;
315 pub const PROC_FLAGMASK = 16;
316 pub const PROF = 16;
317 pub const PROC_FLAG_LWP = 16;
318 pub const POSIX1 = 17;
319 pub const NGROUPS = 18;
320 pub const JOB_CONTROL = 19;
321 pub const SAVED_IDS = 20;
322 pub const BOOTTIME = 21;
323 pub const NISDOMAINNAME = 22;
324 pub const UPDATEINTERVAL = 23;
325 pub const OSRELDATE = 24;
326 pub const NTP_PLL = 25;
327 pub const BOOTFILE = 26;
328 pub const MAXFILESPERPROC = 27;
329 pub const MAXPROCPERUID = 28;
330 pub const DUMPDEV = 29;
331 pub const IPC = 30;
332 pub const DUMMY = 31;
333 pub const PS_STRINGS = 32;
334 pub const USRSTACK = 33;
335 pub const LOGSIGEXIT = 34;
336 pub const IOV_MAX = 35;
337 pub const MAXPOSIXLOCKSPERUID = 36;
338 pub const MAXID = 37;
339};
336340
337341pub const HOST_NAME_MAX = 255;
338342
lib/std/c/freebsd.zig+29-25
......@@ -349,15 +349,19 @@ pub const sockaddr = extern struct {
349349 };
350350};
351351
352pub const CTL_KERN = 1;
353pub const CTL_DEBUG = 5;
352pub const CTL = struct {
353 pub const KERN = 1;
354 pub const DEBUG = 5;
355};
354356
355pub const KERN_PROC = 14; // struct: process entries
356pub const KERN_PROC_PATHNAME = 12; // path to executable
357pub const KERN_IOV_MAX = 35;
357pub const KERN = struct {
358 pub const PROC = 14; // struct: process entries
359 pub const PROC_PATHNAME = 12; // path to executable
360 pub const IOV_MAX = 35;
361};
358362
359363pub const PATH_MAX = 1024;
360pub const IOV_MAX = KERN_IOV_MAX;
364pub const IOV_MAX = KERN.IOV_MAX;
361365
362366pub const STDIN_FILENO = 0;
363367pub const STDOUT_FILENO = 1;
......@@ -413,6 +417,25 @@ pub const W = struct {
413417 pub const NOWAIT = 8;
414418 pub const EXITED = 16;
415419 pub const TRAPPED = 32;
420
421 pub fn EXITSTATUS(s: u32) u8 {
422 return @intCast(u8, (s & 0xff00) >> 8);
423 }
424 pub fn TERMSIG(s: u32) u32 {
425 return s & 0x7f;
426 }
427 pub fn STOPSIG(s: u32) u32 {
428 return EXITSTATUS(s);
429 }
430 pub fn IFEXITED(s: u32) bool {
431 return TERMSIG(s) == 0;
432 }
433 pub fn IFSTOPPED(s: u32) bool {
434 return @intCast(u16, (((s & 0xffff) *% 0x10001) >> 8)) > 0x7f00;
435 }
436 pub fn IFSIGNALED(s: u32) bool {
437 return (s & 0xffff) -% 1 < 0xff;
438 }
416439};
417440
418441pub const SA = struct {
......@@ -913,25 +936,6 @@ pub const T = struct {
913936 pub const IOCSIG = 0x2004745f;
914937};
915938
916pub fn WEXITSTATUS(s: u32) u8 {
917 return @intCast(u8, (s & 0xff00) >> 8);
918}
919pub fn WTERMSIG(s: u32) u32 {
920 return s & 0x7f;
921}
922pub fn WSTOPSIG(s: u32) u32 {
923 return WEXITSTATUS(s);
924}
925pub fn WIFEXITED(s: u32) bool {
926 return WTERMSIG(s) == 0;
927}
928pub fn WIFSTOPPED(s: u32) bool {
929 return @intCast(u16, (((s & 0xffff) *% 0x10001) >> 8)) > 0x7f00;
930}
931pub fn WIFSIGNALED(s: u32) bool {
932 return (s & 0xffff) -% 1 < 0xff;
933}
934
935939pub const winsize = extern struct {
936940 ws_row: u16,
937941 ws_col: u16,
lib/std/c/haiku.zig+8-4
......@@ -365,11 +365,15 @@ pub const sockaddr = extern struct {
365365 };
366366};
367367
368pub const CTL_KERN = 1;
369pub const CTL_DEBUG = 5;
368pub const CTL = struct {
369 pub const KERN = 1;
370 pub const DEBUG = 5;
371};
370372
371pub const KERN_PROC = 14; // struct: process entries
372pub const KERN_PROC_PATHNAME = 12; // path to executable
373pub const KERN = struct {
374 pub const PROC = 14; // struct: process entries
375 pub const PROC_PATHNAME = 12; // path to executable
376};
373377
374378pub const PATH_MAX = 1024;
375379
lib/std/c/netbsd.zig+10-6
......@@ -520,15 +520,19 @@ pub const AI = struct {
520520 pub const ADDRCONFIG = 0x00000400;
521521};
522522
523pub const CTL_KERN = 1;
524pub const CTL_DEBUG = 5;
523pub const CTL = struct {
524 pub const KERN = 1;
525 pub const DEBUG = 5;
526};
525527
526pub const KERN_PROC_ARGS = 48; // struct: process argv/env
527pub const KERN_PROC_PATHNAME = 5; // path to executable
528pub const KERN_IOV_MAX = 38;
528pub const KERN = struct {
529 pub const PROC_ARGS = 48; // struct: process argv/env
530 pub const PROC_PATHNAME = 5; // path to executable
531 pub const IOV_MAX = 38;
532};
529533
530534pub const PATH_MAX = 1024;
531pub const IOV_MAX = KERN_IOV_MAX;
535pub const IOV_MAX = KERN.IOV_MAX;
532536
533537pub const STDIN_FILENO = 0;
534538pub const STDOUT_FILENO = 1;
lib/std/c/openbsd.zig+117-114
......@@ -1215,105 +1215,123 @@ pub const POLL = struct {
12151215 pub const WRBAND = 0x0100;
12161216};
12171217
1218// sysctl mib
1219pub const CTL_UNSPEC = 0;
1220pub const CTL_KERN = 1;
1221pub const CTL_VM = 2;
1222pub const CTL_FS = 3;
1223pub const CTL_NET = 4;
1224pub const CTL_DEBUG = 5;
1225pub const CTL_HW = 6;
1226pub const CTL_MACHDEP = 7;
1227
1228pub const CTL_DDB = 9;
1229pub const CTL_VFS = 10;
1230
1231pub const KERN_OSTYPE = 1;
1232pub const KERN_OSRELEASE = 2;
1233pub const KERN_OSREV = 3;
1234pub const KERN_VERSION = 4;
1235pub const KERN_MAXVNODES = 5;
1236pub const KERN_MAXPROC = 6;
1237pub const KERN_MAXFILES = 7;
1238pub const KERN_ARGMAX = 8;
1239pub const KERN_SECURELVL = 9;
1240pub const KERN_HOSTNAME = 10;
1241pub const KERN_HOSTID = 11;
1242pub const KERN_CLOCKRATE = 12;
1243
1244pub const KERN_PROF = 16;
1245pub const KERN_POSIX1 = 17;
1246pub const KERN_NGROUPS = 18;
1247pub const KERN_JOB_CONTROL = 19;
1248pub const KERN_SAVED_IDS = 20;
1249pub const KERN_BOOTTIME = 21;
1250pub const KERN_DOMAINNAME = 22;
1251pub const KERN_MAXPARTITIONS = 23;
1252pub const KERN_RAWPARTITION = 24;
1253pub const KERN_MAXTHREAD = 25;
1254pub const KERN_NTHREADS = 26;
1255pub const KERN_OSVERSION = 27;
1256pub const KERN_SOMAXCONN = 28;
1257pub const KERN_SOMINCONN = 29;
1258
1259pub const KERN_NOSUIDCOREDUMP = 32;
1260pub const KERN_FSYNC = 33;
1261pub const KERN_SYSVMSG = 34;
1262pub const KERN_SYSVSEM = 35;
1263pub const KERN_SYSVSHM = 36;
1264
1265pub const KERN_MSGBUFSIZE = 38;
1266pub const KERN_MALLOCSTATS = 39;
1267pub const KERN_CPTIME = 40;
1268pub const KERN_NCHSTATS = 41;
1269pub const KERN_FORKSTAT = 42;
1270pub const KERN_NSELCOLL = 43;
1271pub const KERN_TTY = 44;
1272pub const KERN_CCPU = 45;
1273pub const KERN_FSCALE = 46;
1274pub const KERN_NPROCS = 47;
1275pub const KERN_MSGBUF = 48;
1276pub const KERN_POOL = 49;
1277pub const KERN_STACKGAPRANDOM = 50;
1278pub const KERN_SYSVIPC_INFO = 51;
1279pub const KERN_ALLOWKMEM = 52;
1280pub const KERN_WITNESSWATCH = 53;
1281pub const KERN_SPLASSERT = 54;
1282pub const KERN_PROC_ARGS = 55;
1283pub const KERN_NFILES = 56;
1284pub const KERN_TTYCOUNT = 57;
1285pub const KERN_NUMVNODES = 58;
1286pub const KERN_MBSTAT = 59;
1287pub const KERN_WITNESS = 60;
1288pub const KERN_SEMINFO = 61;
1289pub const KERN_SHMINFO = 62;
1290pub const KERN_INTRCNT = 63;
1291pub const KERN_WATCHDOG = 64;
1292pub const KERN_ALLOWDT = 65;
1293pub const KERN_PROC = 66;
1294pub const KERN_MAXCLUSTERS = 67;
1295pub const KERN_EVCOUNT = 68;
1296pub const KERN_TIMECOUNTER = 69;
1297pub const KERN_MAXLOCKSPERUID = 70;
1298pub const KERN_CPTIME2 = 71;
1299pub const KERN_CACHEPCT = 72;
1300pub const KERN_FILE = 73;
1301pub const KERN_WXABORT = 74;
1302pub const KERN_CONSDEV = 75;
1303pub const KERN_NETLIVELOCKS = 76;
1304pub const KERN_POOL_DEBUG = 77;
1305pub const KERN_PROC_CWD = 78;
1306pub const KERN_PROC_NOBROADCASTKILL = 79;
1307pub const KERN_PROC_VMMAP = 80;
1308pub const KERN_GLOBAL_PTRACE = 81;
1309pub const KERN_CONSBUFSIZE = 82;
1310pub const KERN_CONSBUF = 83;
1311pub const KERN_AUDIO = 84;
1312pub const KERN_CPUSTATS = 85;
1313pub const KERN_PFSTATUS = 86;
1314pub const KERN_TIMEOUT_STATS = 87;
1315pub const KERN_UTC_OFFSET = 88;
1316pub const KERN_VIDEO = 89;
1218pub const CTL = struct {
1219 pub const UNSPEC = 0;
1220 pub const KERN = 1;
1221 pub const VM = 2;
1222 pub const FS = 3;
1223 pub const NET = 4;
1224 pub const DEBUG = 5;
1225 pub const HW = 6;
1226 pub const MACHDEP = 7;
1227
1228 pub const DDB = 9;
1229 pub const VFS = 10;
1230};
1231
1232pub const KERN = struct {
1233 pub const OSTYPE = 1;
1234 pub const OSRELEASE = 2;
1235 pub const OSREV = 3;
1236 pub const VERSION = 4;
1237 pub const MAXVNODES = 5;
1238 pub const MAXPROC = 6;
1239 pub const MAXFILES = 7;
1240 pub const ARGMAX = 8;
1241 pub const SECURELVL = 9;
1242 pub const HOSTNAME = 10;
1243 pub const HOSTID = 11;
1244 pub const CLOCKRATE = 12;
1245
1246 pub const PROF = 16;
1247 pub const POSIX1 = 17;
1248 pub const NGROUPS = 18;
1249 pub const JOB_CONTROL = 19;
1250 pub const SAVED_IDS = 20;
1251 pub const BOOTTIME = 21;
1252 pub const DOMAINNAME = 22;
1253 pub const MAXPARTITIONS = 23;
1254 pub const RAWPARTITION = 24;
1255 pub const MAXTHREAD = 25;
1256 pub const NTHREADS = 26;
1257 pub const OSVERSION = 27;
1258 pub const SOMAXCONN = 28;
1259 pub const SOMINCONN = 29;
1260
1261 pub const NOSUIDCOREDUMP = 32;
1262 pub const FSYNC = 33;
1263 pub const SYSVMSG = 34;
1264 pub const SYSVSEM = 35;
1265 pub const SYSVSHM = 36;
1266
1267 pub const MSGBUFSIZE = 38;
1268 pub const MALLOCSTATS = 39;
1269 pub const CPTIME = 40;
1270 pub const NCHSTATS = 41;
1271 pub const FORKSTAT = 42;
1272 pub const NSELCOLL = 43;
1273 pub const TTY = 44;
1274 pub const CCPU = 45;
1275 pub const FSCALE = 46;
1276 pub const NPROCS = 47;
1277 pub const MSGBUF = 48;
1278 pub const POOL = 49;
1279 pub const STACKGAPRANDOM = 50;
1280 pub const SYSVIPC_INFO = 51;
1281 pub const ALLOWKMEM = 52;
1282 pub const WITNESSWATCH = 53;
1283 pub const SPLASSERT = 54;
1284 pub const PROC_ARGS = 55;
1285 pub const NFILES = 56;
1286 pub const TTYCOUNT = 57;
1287 pub const NUMVNODES = 58;
1288 pub const MBSTAT = 59;
1289 pub const WITNESS = 60;
1290 pub const SEMINFO = 61;
1291 pub const SHMINFO = 62;
1292 pub const INTRCNT = 63;
1293 pub const WATCHDOG = 64;
1294 pub const ALLOWDT = 65;
1295 pub const PROC = 66;
1296 pub const MAXCLUSTERS = 67;
1297 pub const EVCOUNT = 68;
1298 pub const TIMECOUNTER = 69;
1299 pub const MAXLOCKSPERUID = 70;
1300 pub const CPTIME2 = 71;
1301 pub const CACHEPCT = 72;
1302 pub const FILE = 73;
1303 pub const WXABORT = 74;
1304 pub const CONSDEV = 75;
1305 pub const NETLIVELOCKS = 76;
1306 pub const POOL_DEBUG = 77;
1307 pub const PROC_CWD = 78;
1308 pub const PROC_NOBROADCASTKILL = 79;
1309 pub const PROC_VMMAP = 80;
1310 pub const GLOBAL_PTRACE = 81;
1311 pub const CONSBUFSIZE = 82;
1312 pub const CONSBUF = 83;
1313 pub const AUDIO = 84;
1314 pub const CPUSTATS = 85;
1315 pub const PFSTATUS = 86;
1316 pub const TIMEOUT_STATS = 87;
1317 pub const UTC_OFFSET = 88;
1318 pub const VIDEO = 89;
1319
1320 pub const PROC_ALL = 0;
1321 pub const PROC_PID = 1;
1322 pub const PROC_PGRP = 2;
1323 pub const PROC_SESSION = 3;
1324 pub const PROC_TTY = 4;
1325 pub const PROC_UID = 5;
1326 pub const PROC_RUID = 6;
1327 pub const PROC_KTHREAD = 7;
1328 pub const PROC_SHOW_THREADS = 0x40000000;
1329
1330 pub const PROC_ARGV = 1;
1331 pub const PROC_NARGV = 2;
1332 pub const PROC_ENV = 3;
1333 pub const PROC_NENV = 4;
1334};
13171335
13181336pub const HW_MACHINE = 1;
13191337pub const HW_MODEL = 2;
......@@ -1340,18 +1358,3 @@ pub const HW_ALLOWPOWERDOWN = 22;
13401358pub const HW_PERFPOLICY = 23;
13411359pub const HW_SMT = 24;
13421360pub const HW_NCPUONLINE = 25;
1343
1344pub const KERN_PROC_ALL = 0;
1345pub const KERN_PROC_PID = 1;
1346pub const KERN_PROC_PGRP = 2;
1347pub const KERN_PROC_SESSION = 3;
1348pub const KERN_PROC_TTY = 4;
1349pub const KERN_PROC_UID = 5;
1350pub const KERN_PROC_RUID = 6;
1351pub const KERN_PROC_KTHREAD = 7;
1352pub const KERN_PROC_SHOW_THREADS = 0x40000000;
1353
1354pub const KERN_PROC_ARGV = 1;
1355pub const KERN_PROC_NARGV = 2;
1356pub const KERN_PROC_ENV = 3;
1357pub const KERN_PROC_NENV = 4;
lib/std/fs.zig+3-3
......@@ -344,7 +344,7 @@ pub const Dir = struct {
344344 self.index = 0;
345345 self.end_index = @intCast(usize, rc);
346346 }
347 const darwin_entry = @ptrCast(*align(1) os.darwin.dirent, &self.buf[self.index]);
347 const darwin_entry = @ptrCast(*align(1) os.dirent, &self.buf[self.index]);
348348 const next_index = self.index + darwin_entry.reclen();
349349 self.index = next_index;
350350
......@@ -2442,14 +2442,14 @@ pub fn selfExePath(out_buffer: []u8) SelfExePathError![]u8 {
24422442 switch (builtin.os.tag) {
24432443 .linux => return os.readlinkZ("/proc/self/exe", out_buffer),
24442444 .freebsd, .dragonfly => {
2445 var mib = [4]c_int{ os.CTL_KERN, os.KERN_PROC, os.KERN_PROC_PATHNAME, -1 };
2445 var mib = [4]c_int{ os.CTL.KERN, os.KERN.PROC, os.KERN.PROC_PATHNAME, -1 };
24462446 var out_len: usize = out_buffer.len;
24472447 try os.sysctl(&mib, out_buffer.ptr, &out_len, null, 0);
24482448 // TODO could this slice from 0 to out_len instead?
24492449 return mem.spanZ(std.meta.assumeSentinel(out_buffer.ptr, 0));
24502450 },
24512451 .netbsd => {
2452 var mib = [4]c_int{ os.CTL_KERN, os.KERN_PROC_ARGS, -1, os.KERN_PROC_PATHNAME };
2452 var mib = [4]c_int{ os.CTL.KERN, os.KERN.PROC_ARGS, -1, os.KERN.PROC_PATHNAME };
24532453 var out_len: usize = out_buffer.len;
24542454 try os.sysctl(&mib, out_buffer.ptr, &out_len, null, 0);
24552455 // TODO could this slice from 0 to out_len instead?
lib/std/os.zig+3
......@@ -68,6 +68,7 @@ pub const ARCH = system.ARCH;
6868pub const AT = system.AT;
6969pub const CLOCK = system.CLOCK;
7070pub const CPU_COUNT = system.CPU_COUNT;
71pub const CTL = system.CTL;
7172pub const DT = system.DT;
7273pub const E = system.E;
7374pub const Elf_Symndx = system.Elf_Symndx;
......@@ -78,6 +79,7 @@ pub const HOST_NAME_MAX = system.HOST_NAME_MAX;
7879pub const IFNAMESIZE = system.IFNAMESIZE;
7980pub const IOV_MAX = system.IOV_MAX;
8081pub const IPPROTO = system.IPPROTO;
82pub const KERN = system.KERN;
8183pub const Kevent = system.Kevent;
8284pub const LOCK = system.LOCK;
8385pub const MADV = system.MADV;
......@@ -121,6 +123,7 @@ pub const blksize_t = system.blksize_t;
121123pub const clock_t = system.clock_t;
122124pub const cpu_set_t = system.cpu_set_t;
123125pub const dev_t = system.dev_t;
126pub const dirent = system.dirent;
124127pub const dl_phdr_info = system.dl_phdr_info;
125128pub const empty_sigset = system.empty_sigset;
126129pub const fd_t = system.fd_t;
lib/std/zig/system.zig+2-2
......@@ -309,8 +309,8 @@ pub const NativeTargetInfo = struct {
309309 },
310310 .openbsd => {
311311 const mib: [2]c_int = [_]c_int{
312 std.os.CTL_KERN,
313 std.os.KERN_OSRELEASE,
312 std.os.CTL.KERN,
313 std.os.KERN.OSRELEASE,
314314 };
315315 var buf: [64]u8 = undefined;
316316 var len: usize = buf.len;
lib/std/zig/system/darwin/macos.zig+2-2
......@@ -404,8 +404,8 @@ fn testVersionEquality(expected: std.builtin.Version, got: std.builtin.Version)
404404}
405405
406406pub fn detectNativeCpuAndFeatures() ?Target.Cpu {
407 var cpu_family: os.CPUFAMILY = undefined;
408 var len: usize = @sizeOf(os.CPUFAMILY);
407 var cpu_family: std.c.CPUFAMILY = undefined;
408 var len: usize = @sizeOf(std.c.CPUFAMILY);
409409 os.sysctlbynameZ("hw.cpufamily", &cpu_family, &len, null, 0) catch |err| switch (err) {
410410 error.NameTooLong => unreachable, // constant, known good value
411411 error.PermissionDenied => unreachable, // only when setting values,
src/main.zig+1-1
......@@ -3828,7 +3828,7 @@ fn parseCodeModel(arg: []const u8) std.builtin.CodeModel {
38283828/// garbage collector to run concurrently to zig processes, and to allow multiple
38293829/// zig processes to run concurrently with each other, without clobbering each other.
38303830fn gimmeMoreOfThoseSweetSweetFileDescriptors() void {
3831 if (!@hasDecl(std.os, "rlimit")) return;
3831 if (!@hasDecl(std.os.system, "rlimit")) return;
38323832 const posix = std.os;
38333833
38343834 var lim = posix.getrlimit(.NOFILE) catch return; // Oh well; we tried.