signalfd() question - interaction with threads

From: Colin Walters
Date: Thu Jun 16 2011 - 10:24:49 EST


So in a bit of spare time I have been trying to make GLib use some
more modern Linux features, in particular signalfd(). The quick link
for that is here:

But I ran into a problem - I don't necessarily control all of the
threads in the process, and if any one of them has the signal
unblocked, it will be handled according to its default disposition
there instead of where I want - in the signalfd.

The signalfd example in the man page explicitly documents that you
need to sigprocmask(SIG_BLOCK), which is fine if you control all the
threads in your app, but I don't. Any chance of a new flag like
SFD_HANDLE or SFD_ALWAYS which was rougly equivalent to using
sigaction()? Or even better as I say in the bug, *always* deliver the
signal so I can get an event when a child exits even in the case where
some other code uses sigaction(SIGCHLD)?
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at