| author | |
| committer | |
| log | f8dd4b13d6fe428265229fc1e31c2f8b0cd373b1 |
| tree | ee97556c506b09e566b8d0db2329e9556fb5a768 |
| parent | 057f0fec33c4e54e87383d1181e946d3cddbc4c0 |
11 files changed, 244 insertions(+), 222 deletions(-)
lib/std/Thread.zig+1-1| ... | ... | @@ -558,7 +558,7 @@ const PosixThreadImpl = struct { |
| 558 | 558 | .openbsd => { |
| 559 | 559 | var count: c_int = undefined; |
| 560 | 560 | 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 }; | |
| 562 | 562 | os.sysctl(&mib, &count, &count_size, null, 0) catch |err| switch (err) { |
| 563 | 563 | error.NameTooLong, error.UnknownName => unreachable, |
| 564 | 564 | else => |e| return e, |
lib/std/c/dragonfly.zig+68-64| ... | ... | @@ -221,7 +221,7 @@ pub const SA = struct { |
| 221 | 221 | }; |
| 222 | 222 | |
| 223 | 223 | pub const PATH_MAX = 1024; |
| 224 | pub const IOV_MAX = KERN_IOV_MAX; | |
| 224 | pub const IOV_MAX = KERN.IOV_MAX; | |
| 225 | 225 | |
| 226 | 226 | pub const ino_t = c_ulong; |
| 227 | 227 | |
| ... | ... | @@ -270,69 +270,73 @@ pub const timeval = extern struct { |
| 270 | 270 | tv_usec: suseconds_t, |
| 271 | 271 | }; |
| 272 | 272 | |
| 273 | pub const CTL_UNSPEC = 0; | |
| 274 | pub const CTL_KERN = 1; | |
| 275 | pub const CTL_VM = 2; | |
| 276 | pub const CTL_VFS = 3; | |
| 277 | pub const CTL_NET = 4; | |
| 278 | pub const CTL_DEBUG = 5; | |
| 279 | pub const CTL_HW = 6; | |
| 280 | pub const CTL_MACHDEP = 7; | |
| 281 | pub const CTL_USER = 8; | |
| 282 | pub const CTL_LWKT = 10; | |
| 283 | pub const CTL_MAXID = 11; | |
| 284 | pub const CTL_MAXNAME = 12; | |
| 285 | ||
| 286 | pub const KERN_PROC_ALL = 0; | |
| 287 | pub const KERN_OSTYPE = 1; | |
| 288 | pub const KERN_PROC_PID = 1; | |
| 289 | pub const KERN_OSRELEASE = 2; | |
| 290 | pub const KERN_PROC_PGRP = 2; | |
| 291 | pub const KERN_OSREV = 3; | |
| 292 | pub const KERN_PROC_SESSION = 3; | |
| 293 | pub const KERN_VERSION = 4; | |
| 294 | pub const KERN_PROC_TTY = 4; | |
| 295 | pub const KERN_MAXVNODES = 5; | |
| 296 | pub const KERN_PROC_UID = 5; | |
| 297 | pub const KERN_MAXPROC = 6; | |
| 298 | pub const KERN_PROC_RUID = 6; | |
| 299 | pub const KERN_MAXFILES = 7; | |
| 300 | pub const KERN_PROC_ARGS = 7; | |
| 301 | pub const KERN_ARGMAX = 8; | |
| 302 | pub const KERN_PROC_CWD = 8; | |
| 303 | pub const KERN_PROC_PATHNAME = 9; | |
| 304 | pub const KERN_SECURELVL = 9; | |
| 305 | pub const KERN_PROC_SIGTRAMP = 10; | |
| 306 | pub const KERN_HOSTNAME = 10; | |
| 307 | pub const KERN_HOSTID = 11; | |
| 308 | pub const KERN_CLOCKRATE = 12; | |
| 309 | pub const KERN_VNODE = 13; | |
| 310 | pub const KERN_PROC = 14; | |
| 311 | pub const KERN_FILE = 15; | |
| 312 | pub const KERN_PROC_FLAGMASK = 16; | |
| 313 | pub const KERN_PROF = 16; | |
| 314 | pub const KERN_PROC_FLAG_LWP = 16; | |
| 315 | pub const KERN_POSIX1 = 17; | |
| 316 | pub const KERN_NGROUPS = 18; | |
| 317 | pub const KERN_JOB_CONTROL = 19; | |
| 318 | pub const KERN_SAVED_IDS = 20; | |
| 319 | pub const KERN_BOOTTIME = 21; | |
| 320 | pub const KERN_NISDOMAINNAME = 22; | |
| 321 | pub const KERN_UPDATEINTERVAL = 23; | |
| 322 | pub const KERN_OSRELDATE = 24; | |
| 323 | pub const KERN_NTP_PLL = 25; | |
| 324 | pub const KERN_BOOTFILE = 26; | |
| 325 | pub const KERN_MAXFILESPERPROC = 27; | |
| 326 | pub const KERN_MAXPROCPERUID = 28; | |
| 327 | pub const KERN_DUMPDEV = 29; | |
| 328 | pub const KERN_IPC = 30; | |
| 329 | pub const KERN_DUMMY = 31; | |
| 330 | pub const KERN_PS_STRINGS = 32; | |
| 331 | pub const KERN_USRSTACK = 33; | |
| 332 | pub const KERN_LOGSIGEXIT = 34; | |
| 333 | pub const KERN_IOV_MAX = 35; | |
| 334 | pub const KERN_MAXPOSIXLOCKSPERUID = 36; | |
| 335 | pub const KERN_MAXID = 37; | |
| 273 | pub 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 | ||
| 288 | pub 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 | }; | |
| 336 | 340 | |
| 337 | 341 | pub const HOST_NAME_MAX = 255; |
| 338 | 342 |
lib/std/c/freebsd.zig+29-25| ... | ... | @@ -349,15 +349,19 @@ pub const sockaddr = extern struct { |
| 349 | 349 | }; |
| 350 | 350 | }; |
| 351 | 351 | |
| 352 | pub const CTL_KERN = 1; | |
| 353 | pub const CTL_DEBUG = 5; | |
| 352 | pub const CTL = struct { | |
| 353 | pub const KERN = 1; | |
| 354 | pub const DEBUG = 5; | |
| 355 | }; | |
| 354 | 356 | |
| 355 | pub const KERN_PROC = 14; // struct: process entries | |
| 356 | pub const KERN_PROC_PATHNAME = 12; // path to executable | |
| 357 | pub const KERN_IOV_MAX = 35; | |
| 357 | pub 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 | }; | |
| 358 | 362 | |
| 359 | 363 | pub const PATH_MAX = 1024; |
| 360 | pub const IOV_MAX = KERN_IOV_MAX; | |
| 364 | pub const IOV_MAX = KERN.IOV_MAX; | |
| 361 | 365 | |
| 362 | 366 | pub const STDIN_FILENO = 0; |
| 363 | 367 | pub const STDOUT_FILENO = 1; |
| ... | ... | @@ -413,6 +417,25 @@ pub const W = struct { |
| 413 | 417 | pub const NOWAIT = 8; |
| 414 | 418 | pub const EXITED = 16; |
| 415 | 419 | 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 | } | |
| 416 | 439 | }; |
| 417 | 440 | |
| 418 | 441 | pub const SA = struct { |
| ... | ... | @@ -913,25 +936,6 @@ pub const T = struct { |
| 913 | 936 | pub const IOCSIG = 0x2004745f; |
| 914 | 937 | }; |
| 915 | 938 | |
| 916 | pub fn WEXITSTATUS(s: u32) u8 { | |
| 917 | return @intCast(u8, (s & 0xff00) >> 8); | |
| 918 | } | |
| 919 | pub fn WTERMSIG(s: u32) u32 { | |
| 920 | return s & 0x7f; | |
| 921 | } | |
| 922 | pub fn WSTOPSIG(s: u32) u32 { | |
| 923 | return WEXITSTATUS(s); | |
| 924 | } | |
| 925 | pub fn WIFEXITED(s: u32) bool { | |
| 926 | return WTERMSIG(s) == 0; | |
| 927 | } | |
| 928 | pub fn WIFSTOPPED(s: u32) bool { | |
| 929 | return @intCast(u16, (((s & 0xffff) *% 0x10001) >> 8)) > 0x7f00; | |
| 930 | } | |
| 931 | pub fn WIFSIGNALED(s: u32) bool { | |
| 932 | return (s & 0xffff) -% 1 < 0xff; | |
| 933 | } | |
| 934 | ||
| 935 | 939 | pub const winsize = extern struct { |
| 936 | 940 | ws_row: u16, |
| 937 | 941 | ws_col: u16, |
lib/std/c/haiku.zig+8-4| ... | ... | @@ -365,11 +365,15 @@ pub const sockaddr = extern struct { |
| 365 | 365 | }; |
| 366 | 366 | }; |
| 367 | 367 | |
| 368 | pub const CTL_KERN = 1; | |
| 369 | pub const CTL_DEBUG = 5; | |
| 368 | pub const CTL = struct { | |
| 369 | pub const KERN = 1; | |
| 370 | pub const DEBUG = 5; | |
| 371 | }; | |
| 370 | 372 | |
| 371 | pub const KERN_PROC = 14; // struct: process entries | |
| 372 | pub const KERN_PROC_PATHNAME = 12; // path to executable | |
| 373 | pub const KERN = struct { | |
| 374 | pub const PROC = 14; // struct: process entries | |
| 375 | pub const PROC_PATHNAME = 12; // path to executable | |
| 376 | }; | |
| 373 | 377 | |
| 374 | 378 | pub const PATH_MAX = 1024; |
| 375 | 379 |
lib/std/c/netbsd.zig+10-6| ... | ... | @@ -520,15 +520,19 @@ pub const AI = struct { |
| 520 | 520 | pub const ADDRCONFIG = 0x00000400; |
| 521 | 521 | }; |
| 522 | 522 | |
| 523 | pub const CTL_KERN = 1; | |
| 524 | pub const CTL_DEBUG = 5; | |
| 523 | pub const CTL = struct { | |
| 524 | pub const KERN = 1; | |
| 525 | pub const DEBUG = 5; | |
| 526 | }; | |
| 525 | 527 | |
| 526 | pub const KERN_PROC_ARGS = 48; // struct: process argv/env | |
| 527 | pub const KERN_PROC_PATHNAME = 5; // path to executable | |
| 528 | pub const KERN_IOV_MAX = 38; | |
| 528 | pub 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 | }; | |
| 529 | 533 | |
| 530 | 534 | pub const PATH_MAX = 1024; |
| 531 | pub const IOV_MAX = KERN_IOV_MAX; | |
| 535 | pub const IOV_MAX = KERN.IOV_MAX; | |
| 532 | 536 | |
| 533 | 537 | pub const STDIN_FILENO = 0; |
| 534 | 538 | pub const STDOUT_FILENO = 1; |
lib/std/c/openbsd.zig+117-114| ... | ... | @@ -1215,105 +1215,123 @@ pub const POLL = struct { |
| 1215 | 1215 | pub const WRBAND = 0x0100; |
| 1216 | 1216 | }; |
| 1217 | 1217 | |
| 1218 | // sysctl mib | |
| 1219 | pub const CTL_UNSPEC = 0; | |
| 1220 | pub const CTL_KERN = 1; | |
| 1221 | pub const CTL_VM = 2; | |
| 1222 | pub const CTL_FS = 3; | |
| 1223 | pub const CTL_NET = 4; | |
| 1224 | pub const CTL_DEBUG = 5; | |
| 1225 | pub const CTL_HW = 6; | |
| 1226 | pub const CTL_MACHDEP = 7; | |
| 1227 | ||
| 1228 | pub const CTL_DDB = 9; | |
| 1229 | pub const CTL_VFS = 10; | |
| 1230 | ||
| 1231 | pub const KERN_OSTYPE = 1; | |
| 1232 | pub const KERN_OSRELEASE = 2; | |
| 1233 | pub const KERN_OSREV = 3; | |
| 1234 | pub const KERN_VERSION = 4; | |
| 1235 | pub const KERN_MAXVNODES = 5; | |
| 1236 | pub const KERN_MAXPROC = 6; | |
| 1237 | pub const KERN_MAXFILES = 7; | |
| 1238 | pub const KERN_ARGMAX = 8; | |
| 1239 | pub const KERN_SECURELVL = 9; | |
| 1240 | pub const KERN_HOSTNAME = 10; | |
| 1241 | pub const KERN_HOSTID = 11; | |
| 1242 | pub const KERN_CLOCKRATE = 12; | |
| 1243 | ||
| 1244 | pub const KERN_PROF = 16; | |
| 1245 | pub const KERN_POSIX1 = 17; | |
| 1246 | pub const KERN_NGROUPS = 18; | |
| 1247 | pub const KERN_JOB_CONTROL = 19; | |
| 1248 | pub const KERN_SAVED_IDS = 20; | |
| 1249 | pub const KERN_BOOTTIME = 21; | |
| 1250 | pub const KERN_DOMAINNAME = 22; | |
| 1251 | pub const KERN_MAXPARTITIONS = 23; | |
| 1252 | pub const KERN_RAWPARTITION = 24; | |
| 1253 | pub const KERN_MAXTHREAD = 25; | |
| 1254 | pub const KERN_NTHREADS = 26; | |
| 1255 | pub const KERN_OSVERSION = 27; | |
| 1256 | pub const KERN_SOMAXCONN = 28; | |
| 1257 | pub const KERN_SOMINCONN = 29; | |
| 1258 | ||
| 1259 | pub const KERN_NOSUIDCOREDUMP = 32; | |
| 1260 | pub const KERN_FSYNC = 33; | |
| 1261 | pub const KERN_SYSVMSG = 34; | |
| 1262 | pub const KERN_SYSVSEM = 35; | |
| 1263 | pub const KERN_SYSVSHM = 36; | |
| 1264 | ||
| 1265 | pub const KERN_MSGBUFSIZE = 38; | |
| 1266 | pub const KERN_MALLOCSTATS = 39; | |
| 1267 | pub const KERN_CPTIME = 40; | |
| 1268 | pub const KERN_NCHSTATS = 41; | |
| 1269 | pub const KERN_FORKSTAT = 42; | |
| 1270 | pub const KERN_NSELCOLL = 43; | |
| 1271 | pub const KERN_TTY = 44; | |
| 1272 | pub const KERN_CCPU = 45; | |
| 1273 | pub const KERN_FSCALE = 46; | |
| 1274 | pub const KERN_NPROCS = 47; | |
| 1275 | pub const KERN_MSGBUF = 48; | |
| 1276 | pub const KERN_POOL = 49; | |
| 1277 | pub const KERN_STACKGAPRANDOM = 50; | |
| 1278 | pub const KERN_SYSVIPC_INFO = 51; | |
| 1279 | pub const KERN_ALLOWKMEM = 52; | |
| 1280 | pub const KERN_WITNESSWATCH = 53; | |
| 1281 | pub const KERN_SPLASSERT = 54; | |
| 1282 | pub const KERN_PROC_ARGS = 55; | |
| 1283 | pub const KERN_NFILES = 56; | |
| 1284 | pub const KERN_TTYCOUNT = 57; | |
| 1285 | pub const KERN_NUMVNODES = 58; | |
| 1286 | pub const KERN_MBSTAT = 59; | |
| 1287 | pub const KERN_WITNESS = 60; | |
| 1288 | pub const KERN_SEMINFO = 61; | |
| 1289 | pub const KERN_SHMINFO = 62; | |
| 1290 | pub const KERN_INTRCNT = 63; | |
| 1291 | pub const KERN_WATCHDOG = 64; | |
| 1292 | pub const KERN_ALLOWDT = 65; | |
| 1293 | pub const KERN_PROC = 66; | |
| 1294 | pub const KERN_MAXCLUSTERS = 67; | |
| 1295 | pub const KERN_EVCOUNT = 68; | |
| 1296 | pub const KERN_TIMECOUNTER = 69; | |
| 1297 | pub const KERN_MAXLOCKSPERUID = 70; | |
| 1298 | pub const KERN_CPTIME2 = 71; | |
| 1299 | pub const KERN_CACHEPCT = 72; | |
| 1300 | pub const KERN_FILE = 73; | |
| 1301 | pub const KERN_WXABORT = 74; | |
| 1302 | pub const KERN_CONSDEV = 75; | |
| 1303 | pub const KERN_NETLIVELOCKS = 76; | |
| 1304 | pub const KERN_POOL_DEBUG = 77; | |
| 1305 | pub const KERN_PROC_CWD = 78; | |
| 1306 | pub const KERN_PROC_NOBROADCASTKILL = 79; | |
| 1307 | pub const KERN_PROC_VMMAP = 80; | |
| 1308 | pub const KERN_GLOBAL_PTRACE = 81; | |
| 1309 | pub const KERN_CONSBUFSIZE = 82; | |
| 1310 | pub const KERN_CONSBUF = 83; | |
| 1311 | pub const KERN_AUDIO = 84; | |
| 1312 | pub const KERN_CPUSTATS = 85; | |
| 1313 | pub const KERN_PFSTATUS = 86; | |
| 1314 | pub const KERN_TIMEOUT_STATS = 87; | |
| 1315 | pub const KERN_UTC_OFFSET = 88; | |
| 1316 | pub const KERN_VIDEO = 89; | |
| 1218 | pub 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 | ||
| 1232 | pub 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 | }; | |
| 1317 | 1335 | |
| 1318 | 1336 | pub const HW_MACHINE = 1; |
| 1319 | 1337 | pub const HW_MODEL = 2; |
| ... | ... | @@ -1340,18 +1358,3 @@ pub const HW_ALLOWPOWERDOWN = 22; |
| 1340 | 1358 | pub const HW_PERFPOLICY = 23; |
| 1341 | 1359 | pub const HW_SMT = 24; |
| 1342 | 1360 | pub const HW_NCPUONLINE = 25; |
| 1343 | ||
| 1344 | pub const KERN_PROC_ALL = 0; | |
| 1345 | pub const KERN_PROC_PID = 1; | |
| 1346 | pub const KERN_PROC_PGRP = 2; | |
| 1347 | pub const KERN_PROC_SESSION = 3; | |
| 1348 | pub const KERN_PROC_TTY = 4; | |
| 1349 | pub const KERN_PROC_UID = 5; | |
| 1350 | pub const KERN_PROC_RUID = 6; | |
| 1351 | pub const KERN_PROC_KTHREAD = 7; | |
| 1352 | pub const KERN_PROC_SHOW_THREADS = 0x40000000; | |
| 1353 | ||
| 1354 | pub const KERN_PROC_ARGV = 1; | |
| 1355 | pub const KERN_PROC_NARGV = 2; | |
| 1356 | pub const KERN_PROC_ENV = 3; | |
| 1357 | pub const KERN_PROC_NENV = 4; |
lib/std/fs.zig+3-3| ... | ... | @@ -344,7 +344,7 @@ pub const Dir = struct { |
| 344 | 344 | self.index = 0; |
| 345 | 345 | self.end_index = @intCast(usize, rc); |
| 346 | 346 | } |
| 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]); | |
| 348 | 348 | const next_index = self.index + darwin_entry.reclen(); |
| 349 | 349 | self.index = next_index; |
| 350 | 350 | |
| ... | ... | @@ -2442,14 +2442,14 @@ pub fn selfExePath(out_buffer: []u8) SelfExePathError![]u8 { |
| 2442 | 2442 | switch (builtin.os.tag) { |
| 2443 | 2443 | .linux => return os.readlinkZ("/proc/self/exe", out_buffer), |
| 2444 | 2444 | .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 }; | |
| 2446 | 2446 | var out_len: usize = out_buffer.len; |
| 2447 | 2447 | try os.sysctl(&mib, out_buffer.ptr, &out_len, null, 0); |
| 2448 | 2448 | // TODO could this slice from 0 to out_len instead? |
| 2449 | 2449 | return mem.spanZ(std.meta.assumeSentinel(out_buffer.ptr, 0)); |
| 2450 | 2450 | }, |
| 2451 | 2451 | .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 }; | |
| 2453 | 2453 | var out_len: usize = out_buffer.len; |
| 2454 | 2454 | try os.sysctl(&mib, out_buffer.ptr, &out_len, null, 0); |
| 2455 | 2455 | // TODO could this slice from 0 to out_len instead? |
lib/std/os.zig+3| ... | ... | @@ -68,6 +68,7 @@ pub const ARCH = system.ARCH; |
| 68 | 68 | pub const AT = system.AT; |
| 69 | 69 | pub const CLOCK = system.CLOCK; |
| 70 | 70 | pub const CPU_COUNT = system.CPU_COUNT; |
| 71 | pub const CTL = system.CTL; | |
| 71 | 72 | pub const DT = system.DT; |
| 72 | 73 | pub const E = system.E; |
| 73 | 74 | pub const Elf_Symndx = system.Elf_Symndx; |
| ... | ... | @@ -78,6 +79,7 @@ pub const HOST_NAME_MAX = system.HOST_NAME_MAX; |
| 78 | 79 | pub const IFNAMESIZE = system.IFNAMESIZE; |
| 79 | 80 | pub const IOV_MAX = system.IOV_MAX; |
| 80 | 81 | pub const IPPROTO = system.IPPROTO; |
| 82 | pub const KERN = system.KERN; | |
| 81 | 83 | pub const Kevent = system.Kevent; |
| 82 | 84 | pub const LOCK = system.LOCK; |
| 83 | 85 | pub const MADV = system.MADV; |
| ... | ... | @@ -121,6 +123,7 @@ pub const blksize_t = system.blksize_t; |
| 121 | 123 | pub const clock_t = system.clock_t; |
| 122 | 124 | pub const cpu_set_t = system.cpu_set_t; |
| 123 | 125 | pub const dev_t = system.dev_t; |
| 126 | pub const dirent = system.dirent; | |
| 124 | 127 | pub const dl_phdr_info = system.dl_phdr_info; |
| 125 | 128 | pub const empty_sigset = system.empty_sigset; |
| 126 | 129 | pub const fd_t = system.fd_t; |
lib/std/zig/system.zig+2-2| ... | ... | @@ -309,8 +309,8 @@ pub const NativeTargetInfo = struct { |
| 309 | 309 | }, |
| 310 | 310 | .openbsd => { |
| 311 | 311 | 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, | |
| 314 | 314 | }; |
| 315 | 315 | var buf: [64]u8 = undefined; |
| 316 | 316 | 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) |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | pub 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); | |
| 409 | 409 | os.sysctlbynameZ("hw.cpufamily", &cpu_family, &len, null, 0) catch |err| switch (err) { |
| 410 | 410 | error.NameTooLong => unreachable, // constant, known good value |
| 411 | 411 | error.PermissionDenied => unreachable, // only when setting values, |
src/main.zig+1-1| ... | ... | @@ -3828,7 +3828,7 @@ fn parseCodeModel(arg: []const u8) std.builtin.CodeModel { |
| 3828 | 3828 | /// garbage collector to run concurrently to zig processes, and to allow multiple |
| 3829 | 3829 | /// zig processes to run concurrently with each other, without clobbering each other. |
| 3830 | 3830 | fn gimmeMoreOfThoseSweetSweetFileDescriptors() void { |
| 3831 | if (!@hasDecl(std.os, "rlimit")) return; | |
| 3831 | if (!@hasDecl(std.os.system, "rlimit")) return; | |
| 3832 | 3832 | const posix = std.os; |
| 3833 | 3833 | |
| 3834 | 3834 | var lim = posix.getrlimit(.NOFILE) catch return; // Oh well; we tried. |