News for hackers. Stuff that matters.
Re:All about Linux signals - Linux Programming Blog by ajross on Monday April 02, 2012 @06:42PM (#3790464)
Arrgh. How does an article titled "All about Linux signals" not even mention the signalfd() syscall once? Folks: if you're on Linux and need to use signals (i.e. you're reading this article for any practical reason), you need to be using signalfd(). It's not portable to other OSes, but it solves pretty much all the reentrancy and synchronization issues discussed both here and in the article in a very clean way. You get a file descriptor on which you can block cleanly (c.f. select/poll/epoll) and from which you read event notifications on received signals.

Seriously, use it. And OP: please update the blog post to at least point people at it. There's no excuse on a modern linux system for trying to use anything else.

Re:All about Linux signals - Linux Programming Blog by halayli on Monday April 02, 2012 @11:29PM (#3791316)
http://www.linuxprogrammingblog.com/all-about-linux-signals?...

http://www.linuxprogrammingblog.com/code-examples/signalfd

I just wish freebsd and linux folks agree on a standard instead of dealing with multiple ways to handle async events via different poller implementations and hacks.

Re:All about Linux signals - Linux Programming Blog by krakensden on Monday April 02, 2012 @09:52PM (#3791090)
It is, you just missed it. FTFA:

> First we must block the signals we want to handle with signalfd(2) using sigprocmask(2). This function will be described later. Then we call signalfd(2) to create a file descriptor...

Re:All about Linux signals - Linux Programming Blog by ajross on Monday April 02, 2012 @11:07PM (#3791261)
OK, I call uncle. I can't find that text. It's not on the page titled "waiting for a signal", which seems like the obvious candidate. Nor is it in "signals and threads", which would have been my second choice. Nor "That's not everything!". Enlighten me with a link?
Re:All about Linux signals - Linux Programming Blog by krakensden on Monday April 02, 2012 @11:17PM (#3791286)
I clicked "show full page", but I think it's on page 3

http://www.linuxprogrammingblog.com/all-about-linux-signals?...