3 ms·
C tends towards using in-band error signaling, which is indeed likely to lead to the kill(-1) problem discussed in the article. ... that said, there are other
by JoachimSchipper 6y ago
C tends towards using in-band error signaling, which is indeed likely to lead to the kill(-1) problem discussed in the article.
... that said, there are other ways to get error handling wrong, and e.g. some (scripting) languages tend to have very succinct specifications of functions, which often leaves out important details and/or error handling. Contrast Python's https://docs.python.org/3/library/os.html#os.fork https://docs.python.org/3/library/os.html#os.fork with OpenBSD's https://man.openbsd.org/fork.2 https://man.openbsd.org/fork.2 (or POSIX' https://pubs.opengroup.org/onlinepubs/9699919799/functions/fork.html https://pubs.opengroup.org/onlinepubs/9699919799/functions/f...). Python's solution works reasonably well here - there's not that much you can do to handle fork() failing - but os.fork() isn't exactly the worst-documented part of the Python standard library either...