Re:Why isn't memset() async-signal-safe?
by Skunkleton on Tuesday January 03, 2017 @06:00PM
(#13314071)
It isn't POSIX, but Linux does have the very useful signalfd, which creates a file descriptor that accepts signals. This is a good solution for some types of programs.
[ Parent
| on HN ]
Re:Why isn't memset() async-signal-safe?
by SFJulie on Tuesday January 03, 2017 @06:03PM
(#13314098)
But as pointed in this old HN story it is useless in this case.
Re:Why isn't memset() async-signal-safe?
by Skunkleton on Thursday January 05, 2017 @11:51AM
(#13328716)
It is an easy solution to the problem discussed above though. Yeah, all the mechanics of setting up your signals still are a PITA, but at least you don't have to worry about async-safe functions anymore.
Really all signalfd does is provide an easy way to handle signals in an epoll driven application. If you have a different kind of main loop, then you are probably back to stuffing messages into queues, or dealing with all of the async-safe BS.