2 ms·
Linux has signalfd(): use it! Avoiding the nightmare of having random syscalls interrupted that is impossible to test and almost always results in failures in
by bcrl 5y ago
Linux has signalfd(): use it! Avoiding the nightmare of having random syscalls interrupted that is impossible to test and almost always results in failures in production. If you can't use signalfd(), spawn all your processes / threads from a thread that does nothing other than handle SIGCHLD. I've been through the hell of doing it other ways, and it is hell to get correct on a codebase with more than a couple of developers on it, as very few developers remember to think about the consequences of a signal being received during every single syscall or library call.