| ... | @@ -1494,38 +1494,33 @@ pub const speed_t = switch (native_os) { | ... | @@ -1494,38 +1494,33 @@ pub const speed_t = switch (native_os) { |
| 1494 | pub const whence_t = if (native_os == .wasi) std.os.wasi.whence_t else c_int; | 1494 | pub const whence_t = if (native_os == .wasi) std.os.wasi.whence_t else c_int; |
| 1495 | | 1495 | |
| 1496 | // Unix-like systems | 1496 | // Unix-like systems |
| 1497 | pub usingnamespace switch (native_os) { | 1497 | pub const DIR = opaque {}; |
| 1498 | .netbsd, .windows => struct {}, | 1498 | pub extern "c" fn opendir(pathname: [*:0]const u8) ?*DIR; |
| 1499 | else => struct { | 1499 | pub extern "c" fn fdopendir(fd: c_int) ?*DIR; |
| 1500 | pub const DIR = opaque {}; | 1500 | pub extern "c" fn rewinddir(dp: *DIR) void; |
| 1501 | pub extern "c" fn opendir(pathname: [*:0]const u8) ?*DIR; | 1501 | pub extern "c" fn closedir(dp: *DIR) c_int; |
| 1502 | pub extern "c" fn fdopendir(fd: c_int) ?*DIR; | 1502 | pub extern "c" fn telldir(dp: *DIR) c_long; |
| 1503 | pub extern "c" fn rewinddir(dp: *DIR) void; | 1503 | pub extern "c" fn seekdir(dp: *DIR, loc: c_long) void; |
| 1504 | pub extern "c" fn closedir(dp: *DIR) c_int; | | |
| 1505 | pub extern "c" fn telldir(dp: *DIR) c_long; | | |
| 1506 | pub extern "c" fn seekdir(dp: *DIR, loc: c_long) void; | | |
| 1507 | | 1504 | |
| 1508 | pub extern "c" fn clock_gettime(clk_id: c_int, tp: *c.timespec) c_int; | 1505 | pub extern "c" fn clock_gettime(clk_id: c_int, tp: *c.timespec) c_int; |
| 1509 | pub extern "c" fn clock_getres(clk_id: c_int, tp: *c.timespec) c_int; | 1506 | pub extern "c" fn clock_getres(clk_id: c_int, tp: *c.timespec) c_int; |
| 1510 | pub extern "c" fn gettimeofday(noalias tv: ?*c.timeval, noalias tz: ?*c.timezone) c_int; | 1507 | pub extern "c" fn gettimeofday(noalias tv: ?*c.timeval, noalias tz: ?*c.timezone) c_int; |
| 1511 | pub extern "c" fn nanosleep(rqtp: *const c.timespec, rmtp: ?*c.timespec) c_int; | 1508 | pub extern "c" fn nanosleep(rqtp: *const c.timespec, rmtp: ?*c.timespec) c_int; |
| 1512 | | 1509 | |
| 1513 | pub extern "c" fn getrusage(who: c_int, usage: *c.rusage) c_int; | 1510 | pub extern "c" fn getrusage(who: c_int, usage: *c.rusage) c_int; |
| 1514 | | 1511 | |
| 1515 | pub extern "c" fn sched_yield() c_int; | 1512 | pub extern "c" fn sched_yield() c_int; |
| 1516 | | 1513 | |
| 1517 | pub extern "c" fn sigaction(sig: c_int, noalias act: ?*const c.Sigaction, noalias oact: ?*c.Sigaction) c_int; | 1514 | pub extern "c" fn sigaction(sig: c_int, noalias act: ?*const c.Sigaction, noalias oact: ?*c.Sigaction) c_int; |
| 1518 | pub extern "c" fn sigprocmask(how: c_int, noalias set: ?*const c.sigset_t, noalias oset: ?*c.sigset_t) c_int; | 1515 | pub extern "c" fn sigprocmask(how: c_int, noalias set: ?*const c.sigset_t, noalias oset: ?*c.sigset_t) c_int; |
| 1519 | pub extern "c" fn sigfillset(set: ?*c.sigset_t) void; | 1516 | pub extern "c" fn sigfillset(set: ?*c.sigset_t) void; |
| 1520 | pub extern "c" fn sigwait(set: ?*c.sigset_t, sig: ?*c_int) c_int; | 1517 | pub extern "c" fn sigwait(set: ?*c.sigset_t, sig: ?*c_int) c_int; |
| 1521 | | 1518 | |
| 1522 | pub extern "c" fn socket(domain: c_uint, sock_type: c_uint, protocol: c_uint) c_int; | 1519 | pub extern "c" fn socket(domain: c_uint, sock_type: c_uint, protocol: c_uint) c_int; |
| 1523 | | 1520 | |
| 1524 | pub extern "c" fn alarm(seconds: c_uint) c_uint; | 1521 | pub extern "c" fn alarm(seconds: c_uint) c_uint; |
| 1525 | | 1522 | |
| 1526 | pub extern "c" fn msync(addr: *align(page_size) const anyopaque, len: usize, flags: c_int) c_int; | 1523 | pub extern "c" fn msync(addr: *align(page_size) const anyopaque, len: usize, flags: c_int) c_int; |
| 1527 | }, | | |
| 1528 | }; | | |
| 1529 | | 1524 | |
| 1530 | pub const fstat = switch (native_os) { | 1525 | pub const fstat = switch (native_os) { |
| 1531 | .macos => switch (native_arch) { | 1526 | .macos => switch (native_arch) { |