News for hackers. Stuff that matters.
Re:Everything in C is undefined behavior by BobbyTables2 on Wednesday May 20, 2026 @10:20PM (#48217025)
Couldn’t waitpid return EINTR if the (parent) process were stopped and then continued?

EINTR scares the crap out of me because nobody expects it!

Re:Everything in C is undefined behavior by wahern on Thursday May 21, 2026 @05:13AM (#48219850)
No. You only get EINTR when a signal handler fires and you didn't use the SA_RESTART flag with sigaction. If you don't install any signal handlers, or you use SA_RESTART on all handlers, or you've blocked/masked all signals (or at least the ones with handlers), you won't get EINTR.

When writing library code, it's important to consider EINTR because you can't know about signal dispositions. Though, the common practice of looping on EINTR kind of defeats the purpose.