| ... | ... | @@ -1521,8 +1521,6 @@ pub usingnamespace switch (native_os) { |
| 1521 | 1521 | |
| 1522 | 1522 | pub extern "c" fn socket(domain: c_uint, sock_type: c_uint, protocol: c_uint) c_int; |
| 1523 | 1523 | |
| 1524 | | pub extern "c" fn stat(noalias path: [*:0]const u8, noalias buf: *c.Stat) c_int; |
| 1525 | | |
| 1526 | 1524 | pub extern "c" fn alarm(seconds: c_uint) c_uint; |
| 1527 | 1525 | |
| 1528 | 1526 | pub extern "c" fn msync(addr: *align(page_size) const anyopaque, len: usize, flags: c_int) c_int; |
| ... | ... | @@ -1530,26 +1528,26 @@ pub usingnamespace switch (native_os) { |
| 1530 | 1528 | }; |
| 1531 | 1529 | |
| 1532 | 1530 | pub const fstat = switch (native_os) { |
| 1533 | | .netbsd => private.__fstat50, |
| 1534 | | .macos, .ios, .watchos, .tvos => switch (native_arch) { |
| 1535 | | .aarch64 => private.fstat, |
| 1536 | | else => private.@"fstat$INODE64", |
| 1531 | .macos => switch (native_arch) { |
| 1532 | .x86_64 => private.@"fstat$INODE64", |
| 1533 | else => private.fstat, |
| 1537 | 1534 | }, |
| 1535 | .netbsd => private.__fstat50, |
| 1538 | 1536 | else => private.fstat, |
| 1539 | 1537 | }; |
| 1540 | 1538 | |
| 1541 | 1539 | pub const fstatat = switch (native_os) { |
| 1542 | | .macos, .ios, .watchos, .tvos => switch (native_arch) { |
| 1543 | | .aarch64 => private.fstatat, |
| 1544 | | else => private.@"fstatat$INODE64", |
| 1540 | .macos => switch (native_arch) { |
| 1541 | .x86_64 => private.@"fstatat$INODE64", |
| 1542 | else => private.fstatat, |
| 1545 | 1543 | }, |
| 1546 | 1544 | else => private.fstatat, |
| 1547 | 1545 | }; |
| 1548 | 1546 | |
| 1549 | 1547 | pub const readdir = switch (native_os) { |
| 1550 | | .macos, .ios, .watchos, .tvos => switch (native_arch) { |
| 1551 | | .aarch64 => private.readdir, |
| 1552 | | else => private.@"readdir$INODE64", |
| 1548 | .macos => switch (native_arch) { |
| 1549 | .x86_64 => private.@"readdir$INODE64", |
| 1550 | else => private.readdir, |
| 1553 | 1551 | }, |
| 1554 | 1552 | .windows => @compileError("not available"), |
| 1555 | 1553 | else => private.readdir, |
| ... | ... | @@ -1560,6 +1558,14 @@ pub const realpath = switch (native_os) { |
| 1560 | 1558 | else => private.realpath, |
| 1561 | 1559 | }; |
| 1562 | 1560 | |
| 1561 | pub const stat = switch (native_os) { |
| 1562 | .macos => switch (native_arch) { |
| 1563 | .x86_64 => private.@"stat$INODE64", |
| 1564 | else => private.stat, |
| 1565 | }, |
| 1566 | else => private.stat, |
| 1567 | }; |
| 1568 | |
| 1563 | 1569 | pub fn getErrno(rc: anytype) c.E { |
| 1564 | 1570 | if (rc == -1) { |
| 1565 | 1571 | return @enumFromInt(c._errno().*); |
| ... | ... | @@ -1880,22 +1886,22 @@ else |
| 1880 | 1886 | |
| 1881 | 1887 | const private = struct { |
| 1882 | 1888 | extern "c" fn fstat(fd: c.fd_t, buf: *c.Stat) c_int; |
| 1883 | | /// On x86_64 Darwin, fstat has to be manually linked with $INODE64 suffix to |
| 1884 | | /// force 64bit version. |
| 1885 | | /// Note that this is fixed on aarch64 and no longer necessary. |
| 1886 | | extern "c" fn @"fstat$INODE64"(fd: c.fd_t, buf: *c.Stat) c_int; |
| 1887 | | |
| 1888 | | extern "c" fn fstatat(dirfd: c.fd_t, path: [*:0]const u8, stat_buf: *c.Stat, flags: u32) c_int; |
| 1889 | | /// On x86_64 Darwin, fstatat has to be manually linked with $INODE64 suffix to |
| 1890 | | /// force 64bit version. |
| 1891 | | /// Note that this is fixed on aarch64 and no longer necessary. |
| 1892 | | extern "c" fn @"fstatat$INODE64"(dirfd: c.fd_t, path_name: [*:0]const u8, buf: *c.Stat, flags: u32) c_int; |
| 1893 | | |
| 1894 | | extern "c" fn __fstat50(fd: c.fd_t, buf: *c.Stat) c_int; |
| 1895 | | |
| 1889 | extern "c" fn fstatat(dirfd: c.fd_t, path: [*:0]const u8, buf: *c.Stat, flag: u32) c_int; |
| 1896 | 1890 | extern "c" fn readdir(dir: *c.DIR) ?*c.dirent; |
| 1891 | extern "c" fn realpath(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8; |
| 1892 | extern "c" fn stat(noalias path: [*:0]const u8, noalias buf: *c.Stat) c_int; |
| 1893 | |
| 1894 | /// macos modernized symbols. |
| 1895 | /// x86_64 links to $INODE64 suffix for 64-bit support. |
| 1896 | /// Note these are not necessary on aarch64. |
| 1897 | extern "c" fn @"fstat$INODE64"(fd: c.fd_t, buf: *c.Stat) c_int; |
| 1898 | extern "c" fn @"fstatat$INODE64"(dirfd: c.fd_t, path: [*:0]const u8, buf: *c.Stat, flag: u32) c_int; |
| 1897 | 1899 | extern "c" fn @"readdir$INODE64"(dir: *c.DIR) ?*c.dirent; |
| 1900 | extern "c" fn @"stat$INODE64"(noalias path: [*:0]const u8, noalias buf: *c.Stat) c_int; |
| 1898 | 1901 | |
| 1899 | | extern "c" fn realpath(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8; |
| 1902 | /// macos modernized symbols. |
| 1900 | 1903 | extern "c" fn @"realpath$DARWIN_EXTSN"(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8; |
| 1904 | |
| 1905 | /// netbsd modernized symbols. |
| 1906 | extern "c" fn __fstat50(fd: c.fd_t, buf: *c.Stat) c_int; |
| 1901 | 1907 | }; |