system/darwin
The Darwin calls and layouts the standard library needs.
Split from system/posix because POSIX does not define these: struct stat's
layout is the system's own, and _NSGetExecutablePath is Darwin's answer to
/proc/self/exe. Sibling of system/linux and system/windows.
Functions
ns_get_executable_path :: fn(@c_out buf: u8[], @c_pointer size: u32) -> i32 _NSGetExecutablePath (<mach-o/dyld.h>). 0 on success, non-zero when
buf was too small.
⚠️ C writes the NEEDED capacity back through size and Vader never sees it: a
scalar @c_pointer cannot be an out-parameter (@c_out on one is T3079), the
shim's temporary dying at the return. A caller wanting to retry at the right size
must lend a one-element array instead. The one caller does not: it starts at
4096, four times PATH_MAX on Darwin, and treats failure as "give up".
Darwin's answer to /proc/self/exe. The path it gives may be relative or
carry symlinks, so callers pass it through realpath.
Parameters
| buf | u8[] | No description. |
| size | u32 | No description. |
Returns
i32