3 ms·
It is not the only sane thing to do. kevent() is another way to handle signals. It puts handling them into the program's main event loop, which is done synchr
by JdeBP 9y ago
It is not the only sane thing to do.
kevent() is another way to handle signals. It puts handling them into the program's main event loop, which is done synchronously with normal event-dispatching mechanisms and so does not have worries about asynchronous signal safety, because with kevent() they are just another type of filter.
- slrz 9y agoSure, if you're going to use non-portable constructs, there're better alternatives to the self-pipe thing. Linux has something roughly similar with signalfd. The nice thing about the write-a-byte-to-the-pipe thing is that it works virtually everywhere.