3 ms·
Non-Linux. Most other UNIX platforms also have syscalls depend on the specific C library.
by SAI_Peregrinus 3y ago
Non-Linux. Most other UNIX platforms also have syscalls depend on the specific C library.
- pjmlp 3y agoOn UNIX there is no distinction between C standard library and OS APIs, hence POSIX as the UNIX bits missing from ISO C. I feel you're mixing OS APIs, with the low level mechanism to enter into the kernel space.
- SAI_Peregrinus 3y agoI'm saying that on UNIX, the C standard library provides the OS API, while on Linux the OS API can be accessed directly via syscall numbers (which are stable). But on Linux `getenv()` is still not an OS API, it's provided by libc (musl or glibc, both provide POSIX APIs as well as the ISO C standard library functions and some other extensions and syscall wrappers). > On non-UNIX platforms stuff like getenv() belongs to the specific compiler C library, not the OS API, hence why Windows doesn't use it. Linux isn't a UNIX, and non-POSIX compliant Linux distributions exist. getenv() is still part of the C library, not the OS API, yet Linux distributions still use it. So that's not the only reason why Windows doesn't use it. It's more because Windows design wasn't originally POSIX-compatible (some POSIX wrappers got added with Windows NT) and MS designed their own API.