| author | |
| committer | |
| log | 4f5095840750b64cf95aeeb6d084f9e4f5f5c5b7 |
| tree | c495cf6588b741b6431eb9d129549f1ffaa05d79 |
| parent | bda9a159aa38f67dc76f2f4b7730a916239b27e0 |
2 files changed, 14 insertions(+), 18 deletions(-)
lib/std/c.zig+2-16| ... | @@ -124,14 +124,7 @@ pub extern "c" fn readlinkat(dirfd: fd_t, noalias path: [*:0]const u8, noalias b | ... | @@ -124,14 +124,7 @@ pub extern "c" fn readlinkat(dirfd: fd_t, noalias path: [*:0]const u8, noalias b |
| 124 | pub usingnamespace switch (builtin.os.tag) { | 124 | pub usingnamespace switch (builtin.os.tag) { |
| 125 | .macos, .ios, .watchos, .tvos => struct { | 125 | .macos, .ios, .watchos, .tvos => struct { |
| 126 | pub const realpath = @"realpath$DARWIN_EXTSN"; | 126 | pub const realpath = @"realpath$DARWIN_EXTSN"; |
| 127 | pub usingnamespace switch (builtin.arch) { | 127 | pub const fstatat = _fstatat; |
| 128 | .aarch64 => struct { | ||
| 129 | pub extern "c" fn fstatat(dirfd: fd_t, path: [*:0]const u8, stat_buf: *Stat, flags: u32) c_int; | ||
| 130 | }, | ||
| 131 | else => struct { | ||
| 132 | pub const fstatat = @"fstatat$INODE64"; | ||
| 133 | }, | ||
| 134 | }; | ||
| 135 | }, | 128 | }, |
| 136 | else => struct { | 129 | else => struct { |
| 137 | pub extern "c" fn realpath(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8; | 130 | pub extern "c" fn realpath(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8; |
| ... | @@ -201,14 +194,7 @@ pub usingnamespace switch (builtin.os.tag) { | ... | @@ -201,14 +194,7 @@ pub usingnamespace switch (builtin.os.tag) { |
| 201 | // XXX: getdirentries -> _getdirentries64 | 194 | // XXX: getdirentries -> _getdirentries64 |
| 202 | pub extern "c" fn clock_getres(clk_id: c_int, tp: *timespec) c_int; | 195 | pub extern "c" fn clock_getres(clk_id: c_int, tp: *timespec) c_int; |
| 203 | pub extern "c" fn clock_gettime(clk_id: c_int, tp: *timespec) c_int; | 196 | pub extern "c" fn clock_gettime(clk_id: c_int, tp: *timespec) c_int; |
| 204 | pub usingnamespace switch (builtin.arch) { | 197 | pub const fstat = _fstat; |
| 205 | .aarch64 => struct { | ||
| 206 | pub extern "c" fn fstat(fd: fd_t, buf: *Stat) c_int; | ||
| 207 | }, | ||
| 208 | else => struct { | ||
| 209 | pub const fstat = @"fstat$INODE64"; | ||
| 210 | } | ||
| 211 | }; | ||
| 212 | pub extern "c" fn getrusage(who: c_int, usage: *rusage) c_int; | 198 | pub extern "c" fn getrusage(who: c_int, usage: *rusage) c_int; |
| 213 | pub extern "c" fn gettimeofday(noalias tv: ?*timeval, noalias tz: ?*timezone) c_int; | 199 | pub extern "c" fn gettimeofday(noalias tv: ?*timeval, noalias tz: ?*timezone) c_int; |
| 214 | pub extern "c" fn nanosleep(rqtp: *const timespec, rmtp: ?*timespec) c_int; | 200 | pub extern "c" fn nanosleep(rqtp: *const timespec, rmtp: ?*timespec) c_int; |
lib/std/c/darwin.zig+12-2| ... | @@ -29,8 +29,18 @@ pub extern "c" fn fcopyfile(from: fd_t, to: fd_t, state: ?copyfile_state_t, flag | ... | @@ -29,8 +29,18 @@ pub extern "c" fn fcopyfile(from: fd_t, to: fd_t, state: ?copyfile_state_t, flag |
| 29 | pub extern "c" fn @"realpath$DARWIN_EXTSN"(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8; | 29 | pub extern "c" fn @"realpath$DARWIN_EXTSN"(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8; |
| 30 | 30 | ||
| 31 | pub extern "c" fn __getdirentries64(fd: c_int, buf_ptr: [*]u8, buf_len: usize, basep: *i64) isize; | 31 | pub extern "c" fn __getdirentries64(fd: c_int, buf_ptr: [*]u8, buf_len: usize, basep: *i64) isize; |
| 32 | pub extern "c" fn @"fstat$INODE64"(fd: fd_t, buf: *Stat) c_int; | 32 | |
| 33 | pub extern "c" fn @"fstatat$INODE64"(dirfd: fd_t, path_name: [*:0]const u8, buf: *Stat, flags: u32) c_int; | 33 | extern "c" fn fstat(fd: fd_t, buf: *Stat) c_int; |
| 34 | /// On x86_64 Darwin, fstat has to be manully linked with $INODE64 suffix to force 64bit version. | ||
| 35 | /// Note that this is fixed on aarch64 and no longer necessary. | ||
| 36 | extern "c" fn @"fstat$INODE64"(fd: fd_t, buf: *Stat) c_int; | ||
| 37 | pub const _fstat = if (builtin.arch == .aarch64) fstat else @"fstat$INODE64"; | ||
| 38 | |||
| 39 | extern "c" fn fstatat(dirfd: fd_t, path: [*:0]const u8, stat_buf: *Stat, flags: u32) c_int; | ||
| 40 | /// On x86_64 Darwin, fstatat has to be manully linked with $INODE64 suffix to force 64bit version. | ||
| 41 | /// Note that this is fixed on aarch64 and no longer necessary. | ||
| 42 | extern "c" fn @"fstatat$INODE64"(dirfd: fd_t, path_name: [*:0]const u8, buf: *Stat, flags: u32) c_int; | ||
| 43 | pub const _fstatat = if (builtin.arch == .aarch64) fstatat else @"fstatat$INODE64"; | ||
| 34 | 44 | ||
| 35 | pub extern "c" fn mach_absolute_time() u64; | 45 | pub extern "c" fn mach_absolute_time() u64; |
| 36 | pub extern "c" fn mach_timebase_info(tinfo: ?*mach_timebase_info_data) void; | 46 | pub extern "c" fn mach_timebase_info(tinfo: ?*mach_timebase_info_data) void; |