On Wed, Oct 25, 2023 at 9:47 PM Gabriel Ravier <gabrav...@gmail.com> wrote: > Isn't this a similar situation to e.g. `getuid`/`geteuid`/etc. failures
Not similar enough to draw a conclusion. Unlike system(), those functions are not part of the language defined by ISO C, but the operating system interface defined by POSIX. How operating systems are designed is outside the scope of ISO C; it can not require that system(NULL) perform additional checks to determine if the command processor is currently available, as it might require the user to enter his credentials, have a working internet connection, etc. And an environment where the command shell is unavailable is not supported by POSIX, so system(NULL) always returns non-zero. I don't think POSIX allows (or should allow) system(NULL) to return 0, but feel free to request clarification. -- Oğuz