| author | |
| committer | |
| log | e05923f34b566a47d81ee955ec170a855ac99a1d |
| tree | 8091827cc93d156ecf9bb76f9ae458c7087e1069 |
| parent | 79462bb5916d1e6459e73950dbab444e5b949853 |
macOS 10.15 Catalina causes an ancient variant of `realpath` to fail,
likely due to 10.15's evolving security model.
closes #53252 files changed, 12 insertions(+), 1 deletions(-)
lib/std/c.zig+10-1| ... | ... | @@ -111,7 +111,16 @@ pub extern "c" fn dup(fd: fd_t) c_int; |
| 111 | 111 | pub extern "c" fn dup2(old_fd: fd_t, new_fd: fd_t) c_int; |
| 112 | 112 | pub extern "c" fn readlink(noalias path: [*:0]const u8, noalias buf: [*]u8, bufsize: usize) isize; |
| 113 | 113 | pub extern "c" fn readlinkat(dirfd: fd_t, noalias path: [*:0]const u8, noalias buf: [*]u8, bufsize: usize) isize; |
| 114 | pub extern "c" fn realpath(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8; | |
| 114 | ||
| 115 | pub usingnamespace switch (builtin.os.tag) { | |
| 116 | .macosx, .ios, .watchos, .tvos => struct { | |
| 117 | pub const realpath = @"realpath$DARWIN_EXTSN"; | |
| 118 | }, | |
| 119 | else => struct { | |
| 120 | pub extern "c" fn realpath(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8; | |
| 121 | }, | |
| 122 | }; | |
| 123 | ||
| 115 | 124 | pub extern "c" fn setreuid(ruid: c_uint, euid: c_uint) c_int; |
| 116 | 125 | pub extern "c" fn setregid(rgid: c_uint, egid: c_uint) c_int; |
| 117 | 126 | pub extern "c" fn rmdir(path: [*:0]const u8) c_int; |
lib/std/c/darwin.zig+2| ... | ... | @@ -12,6 +12,8 @@ pub extern "c" fn _dyld_get_image_header(image_index: u32) ?*mach_header; |
| 12 | 12 | pub extern "c" fn _dyld_get_image_vmaddr_slide(image_index: u32) usize; |
| 13 | 13 | pub extern "c" fn _dyld_get_image_name(image_index: u32) [*:0]const u8; |
| 14 | 14 | |
| 15 | pub extern "c" fn @"realpath$DARWIN_EXTSN"(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8; | |
| 16 | ||
| 15 | 17 | pub extern "c" fn __getdirentries64(fd: c_int, buf_ptr: [*]u8, buf_len: usize, basep: *i64) isize; |
| 16 | 18 | pub extern "c" fn @"fstat$INODE64"(fd: fd_t, buf: *Stat) c_int; |
| 17 | 19 |