4 ms·
While HN is discussing XNU sycalls, anyone know why the most fundamental of syscalls, execve, according to NeXT/Apple's post-UNIX wisdom needs to have an extra
by gwu78 10y ago
While HN is discussing XNU sycalls, anyone know why the most fundamental of syscalls, execve, according to NeXT/Apple's post-UNIX wisdom needs to have an extra "char *apple[]" argument vector?
Not to imply that it is "hidden" but I am curious if any HN users know about this and understand its purpose?
- seba_dos1 10y agohttps://unixjunkie.blogspot.com/2006/02/char-apple-argument-vector.html https://unixjunkie.blogspot.com/2006/02/char-apple-argument-...
- msbarnett 10y agoWhen in doubt, consult the source: https://github.com/opensource-apple/xnu/blob/53c5e2e62fc4182595609153d4b99648da577c39/bsd/kern/kern_exec.c#L4131 https://github.com/opensource-apple/xnu/blob/53c5e2e62fc4182... The upshot is that it looks like it constructs some non-env variable environment data on the program's stack after the posix environment. The absolute path of the executable, followed by preemption free zone addresses, entropy, a configuration setting for malloc allocation strategy, and the address of the main thread's stack afaict.