Re:Signalfd Is Useless
by thayne on Saturday May 25, 2024 @03:36AM
(#40473304)
The point of the article is that signald could and probably should be more useful than it is.
Even if you don't worry about coalescing, it would be a lot more useful if you didn't have to separately set the signal mask, and reset it for child processes.
> If you get a SIGCHLD, you can call wait() to get information
But you don't know how many signals actually happened, so what you actually need to do is call waitpid in non-blocking mode in a loop until you don't get an actual pid back. Or poll pidfd file descriptors.
Even if you don't worry about coalescing, it would be a lot more useful if you didn't have to separately set the signal mask, and reset it for child processes.
> If you get a SIGCHLD, you can call wait() to get information
But you don't know how many signals actually happened, so what you actually need to do is call waitpid in non-blocking mode in a loop until you don't get an actual pid back. Or poll pidfd file descriptors.