4 ms·
> macOS doesn't provide a stable system call API I'm really wondering, do you have any links about macOS syscall stability over versions?
by slonopotamus 3y ago
> macOS doesn't provide a stable system call API
I'm really wondering, do you have any links about macOS syscall stability over versions?
- kevincox 3y agoI do not. I'm not really a macOS user but have heard this mentioned many times. I remember one recent example is Golang switched from doing raw syscalls to using the macOS libc due to this issue. That was probably ~5 years ago now so you may be able to dig up examples there.
- lgg 3y agoGenerally speaking macOS does not guarantee syscall stability, and does not generally guarantee compatibility for any binaries not linked to `libSystem.dylib` (that is the supported ABI boundary)[1]. This has a number of implications, including (but not limited to): * The most obvious is the commonly mentioned fact that syscalls may change. Here is an example where golang program broke because they were directly using the `gettimeofday()` syscalls[2]. * The interface between the kernel and the dynamic linker (which is required since ABI stability for statically linked executables is not guaranteed) is private and may change between versions. That means if your chroot contains a `dyld` from an OS version that is not the same as the host kernel it may not work. * The format of the dyld shared cache changes most releases, which means you can't just use the old dyld that matches the host kernel in your chroot because it may not work with the dyld shared cache for the OS you are trying to run in the chroot. * The system maintains a number of security policies around platform binaries, and those binaries are enumerated as part of the static trust cache[3]. Depending on what you are doing and what permissions it needs you may not be able to even run the system binaries from another release of macOS. In practice you can often get away with a slight skew (~1 year), but you can rarely get away with skews of more than 2-3 years. [1]: https://developer.apple.com/library/archive/qa/qa1118/_index.html https://developer.apple.com/library/archive/qa/qa1118/_index... [2]: https://github.com/golang/go/issues/16606 https://github.com/golang/go/issues/16606 [3]: https://support.apple.com/guide/security/trust-caches-sec7d38fbf97/web https://support.apple.com/guide/security/trust-caches-sec7d3...