| ... | ... | @@ -1502,25 +1502,19 @@ pub extern "c" fn closedir(dp: *DIR) c_int; |
| 1502 | 1502 | pub extern "c" fn telldir(dp: *DIR) c_long; |
| 1503 | 1503 | pub extern "c" fn seekdir(dp: *DIR, loc: c_long) void; |
| 1504 | 1504 | |
| 1505 | | pub extern "c" fn clock_gettime(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; |
| 1507 | | pub extern "c" fn gettimeofday(noalias tv: ?*c.timeval, noalias tz: ?*c.timezone) c_int; |
| 1508 | | pub extern "c" fn nanosleep(rqtp: *const c.timespec, rmtp: ?*c.timespec) c_int; |
| 1509 | | |
| 1510 | | pub extern "c" fn getrusage(who: c_int, usage: *c.rusage) c_int; |
| 1511 | | |
| 1512 | | pub extern "c" fn sched_yield() c_int; |
| 1513 | | |
| 1514 | | pub extern "c" fn sigaction(sig: c_int, noalias act: ?*const c.Sigaction, noalias oact: ?*c.Sigaction) c_int; |
| 1515 | | pub extern "c" fn sigprocmask(how: c_int, noalias set: ?*const c.sigset_t, noalias oset: ?*c.sigset_t) c_int; |
| 1516 | | pub extern "c" fn sigfillset(set: ?*c.sigset_t) void; |
| 1517 | 1505 | pub extern "c" fn sigwait(set: ?*c.sigset_t, sig: ?*c_int) c_int; |
| 1518 | 1506 | |
| 1519 | | pub extern "c" fn socket(domain: c_uint, sock_type: c_uint, protocol: c_uint) c_int; |
| 1520 | | |
| 1521 | 1507 | pub extern "c" fn alarm(seconds: c_uint) c_uint; |
| 1522 | 1508 | |
| 1523 | | pub extern "c" fn msync(addr: *align(page_size) const anyopaque, len: usize, flags: c_int) c_int; |
| 1509 | pub const clock_getres = switch (native_os) { |
| 1510 | .netbsd => private.__clock_getres50, |
| 1511 | else => private.clock_getres, |
| 1512 | }; |
| 1513 | |
| 1514 | pub const clock_gettime = switch (native_os) { |
| 1515 | .netbsd => private.__clock_gettime50, |
| 1516 | else => private.clock_gettime, |
| 1517 | }; |
| 1524 | 1518 | |
| 1525 | 1519 | pub const fstat = switch (native_os) { |
| 1526 | 1520 | .macos => switch (native_arch) { |
| ... | ... | @@ -1539,6 +1533,31 @@ pub const fstatat = switch (native_os) { |
| 1539 | 1533 | else => private.fstatat, |
| 1540 | 1534 | }; |
| 1541 | 1535 | |
| 1536 | pub const getdirentries = switch (native_os) { |
| 1537 | .macos, .ios, .tvos, .watchos => private.__getdirentries64, |
| 1538 | else => private.getdirentries, |
| 1539 | }; |
| 1540 | |
| 1541 | pub const getrusage = switch (native_os) { |
| 1542 | .netbsd => private.__getrusage50, |
| 1543 | else => private.getrusage, |
| 1544 | }; |
| 1545 | |
| 1546 | pub const gettimeofday = switch (native_os) { |
| 1547 | .netbsd => private.__gettimeofday50, |
| 1548 | else => private.gettimeofday, |
| 1549 | }; |
| 1550 | |
| 1551 | pub const msync = switch (native_os) { |
| 1552 | .netbsd => private.__msync13, |
| 1553 | else => private.msync, |
| 1554 | }; |
| 1555 | |
| 1556 | pub const nanosleep = switch (native_os) { |
| 1557 | .netbsd => private.__nanosleep50, |
| 1558 | else => private.nanosleep, |
| 1559 | }; |
| 1560 | |
| 1542 | 1561 | pub const readdir = switch (native_os) { |
| 1543 | 1562 | .macos => switch (native_arch) { |
| 1544 | 1563 | .x86_64 => private.@"readdir$INODE64", |
| ... | ... | @@ -1549,10 +1568,35 @@ pub const readdir = switch (native_os) { |
| 1549 | 1568 | }; |
| 1550 | 1569 | |
| 1551 | 1570 | pub const realpath = switch (native_os) { |
| 1552 | | .macos, .ios, .watchos, .tvos => private.@"realpath$DARWIN_EXTSN", |
| 1571 | .macos, .ios, .tvos, .watchos => private.@"realpath$DARWIN_EXTSN", |
| 1553 | 1572 | else => private.realpath, |
| 1554 | 1573 | }; |
| 1555 | 1574 | |
| 1575 | pub const sched_yield = switch (native_os) { |
| 1576 | .netbsd => private.__libc_thr_yield, |
| 1577 | else => private.sched_yield, |
| 1578 | }; |
| 1579 | |
| 1580 | pub const sigaction = switch (native_os) { |
| 1581 | .netbsd => private.__sigaction14, |
| 1582 | else => private.sigaction, |
| 1583 | }; |
| 1584 | |
| 1585 | pub const sigfillset = switch (native_os) { |
| 1586 | .netbsd => private.__sigfillset14, |
| 1587 | else => private.sigfillset, |
| 1588 | }; |
| 1589 | |
| 1590 | pub const sigprocmask = switch (native_os) { |
| 1591 | .netbsd => private.__sigprocmask14, |
| 1592 | else => private.sigprocmask, |
| 1593 | }; |
| 1594 | |
| 1595 | pub const socket = switch (native_os) { |
| 1596 | .netbsd => private.__socket30, |
| 1597 | else => private.socket, |
| 1598 | }; |
| 1599 | |
| 1556 | 1600 | pub const stat = switch (native_os) { |
| 1557 | 1601 | .macos => switch (native_arch) { |
| 1558 | 1602 | .x86_64 => private.@"stat$INODE64", |
| ... | ... | @@ -1680,7 +1724,6 @@ pub extern "c" fn recvfrom( |
| 1680 | 1724 | pub extern "c" fn recvmsg(sockfd: c.fd_t, msg: *c.msghdr, flags: u32) isize; |
| 1681 | 1725 | |
| 1682 | 1726 | pub extern "c" fn kill(pid: c.pid_t, sig: c_int) c_int; |
| 1683 | | pub extern "c" fn getdirentries(fd: c.fd_t, buf_ptr: [*]u8, nbytes: usize, basep: *i64) isize; |
| 1684 | 1727 | |
| 1685 | 1728 | pub extern "c" fn setuid(uid: c.uid_t) c_int; |
| 1686 | 1729 | pub extern "c" fn setgid(gid: c.gid_t) c_int; |
| ... | ... | @@ -1878,10 +1921,22 @@ else |
| 1878 | 1921 | }; |
| 1879 | 1922 | |
| 1880 | 1923 | const private = struct { |
| 1924 | extern "c" fn clock_getres(clk_id: c_int, tp: *c.timespec) c_int; |
| 1925 | extern "c" fn clock_gettime(clk_id: c_int, tp: *c.timespec) c_int; |
| 1881 | 1926 | extern "c" fn fstat(fd: c.fd_t, buf: *c.Stat) c_int; |
| 1882 | 1927 | extern "c" fn fstatat(dirfd: c.fd_t, path: [*:0]const u8, buf: *c.Stat, flag: u32) c_int; |
| 1928 | extern "c" fn getdirentries(fd: c.fd_t, buf_ptr: [*]u8, nbytes: usize, basep: *i64) isize; |
| 1929 | extern "c" fn getrusage(who: c_int, usage: *c.rusage) c_int; |
| 1930 | extern "c" fn gettimeofday(noalias tv: ?*c.timeval, noalias tz: ?*c.timezone) c_int; |
| 1931 | extern "c" fn msync(addr: *align(page_size) const anyopaque, len: usize, flags: c_int) c_int; |
| 1932 | extern "c" fn nanosleep(rqtp: *const c.timespec, rmtp: ?*c.timespec) c_int; |
| 1883 | 1933 | extern "c" fn readdir(dir: *c.DIR) ?*c.dirent; |
| 1884 | 1934 | extern "c" fn realpath(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8; |
| 1935 | extern "c" fn sched_yield() c_int; |
| 1936 | extern "c" fn sigaction(sig: c_int, noalias act: ?*const c.Sigaction, noalias oact: ?*c.Sigaction) c_int; |
| 1937 | extern "c" fn sigfillset(set: ?*c.sigset_t) void; |
| 1938 | extern "c" fn sigprocmask(how: c_int, noalias set: ?*const c.sigset_t, noalias oset: ?*c.sigset_t) c_int; |
| 1939 | extern "c" fn socket(domain: c_uint, sock_type: c_uint, protocol: c_uint) c_int; |
| 1885 | 1940 | extern "c" fn stat(noalias path: [*:0]const u8, noalias buf: *c.Stat) c_int; |
| 1886 | 1941 | |
| 1887 | 1942 | /// macos modernized symbols. |
| ... | ... | @@ -1894,7 +1949,20 @@ const private = struct { |
| 1894 | 1949 | |
| 1895 | 1950 | /// macos modernized symbols. |
| 1896 | 1951 | extern "c" fn @"realpath$DARWIN_EXTSN"(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8; |
| 1952 | extern "c" fn __getdirentries64(fd: c.fd_t, buf_ptr: [*]u8, buf_len: usize, basep: *i64) isize; |
| 1897 | 1953 | |
| 1898 | 1954 | /// netbsd modernized symbols. |
| 1955 | extern "c" fn __clock_getres50(clk_id: c_int, tp: *c.timespec) c_int; |
| 1956 | extern "c" fn __clock_gettime50(clk_id: c_int, tp: *c.timespec) c_int; |
| 1899 | 1957 | extern "c" fn __fstat50(fd: c.fd_t, buf: *c.Stat) c_int; |
| 1958 | extern "c" fn __getrusage50(who: c_int, usage: *c.rusage) c_int; |
| 1959 | extern "c" fn __gettimeofday50(noalias tv: ?*c.timeval, noalias tz: ?*c.timezone) c_int; |
| 1960 | extern "c" fn __libc_thr_yield() c_int; |
| 1961 | extern "c" fn __msync13(addr: *align(std.mem.page_size) const anyopaque, len: usize, flags: c_int) c_int; |
| 1962 | extern "c" fn __nanosleep50(rqtp: *const c.timespec, rmtp: ?*c.timespec) c_int; |
| 1963 | extern "c" fn __sigaction14(sig: c_int, noalias act: ?*const c.Sigaction, noalias oact: ?*c.Sigaction) c_int; |
| 1964 | extern "c" fn __sigfillset14(set: ?*c.sigset_t) void; |
| 1965 | extern "c" fn __sigprocmask14(how: c_int, noalias set: ?*const c.sigset_t, noalias oset: ?*c.sigset_t) c_int; |
| 1966 | extern "c" fn __socket30(domain: c_uint, sock_type: c_uint, protocol: c_uint) c_int; |
| 1967 | extern "c" fn __stat50(path: [*:0]const u8, buf: *c.Stat) c_int; |
| 1900 | 1968 | }; |