Well, I think using both this mechanism and normal signal delivery would
be pretty much insane. But if you do, then the only sane way to use the
interface is if each signal is delivered once - and only once - by
whatever mechanism (otherwise how would you be able to distinguish
between the same signal duplicated vs two signals which look very
similar?). If you're really worried about losing a signal between poll
and read you can always make the fd nonblocking.
OK, but if you allow the kernel to duplicate along different delivery
paths, usermode pretty much has to go to the effort of making sure
there's only one delivery path in order to keep track of how many
signals really appeared.
The only way to make duplication sane is to guarantee that if a signal
path *can* deliver a signal, it *will* deliver the signal, so that
usermode has some chance of correlating queued signals along each path.
But if you do that, then you end up with bad results. If you have a
signal blocked, then it means you're obligated to keep the signal queued
forever in case the signal gets unblocked, even if usermode already got
it via a signalfd and has no intention of ever unblocking the signal.
Similarly with a signalfd that never gets read. And if you fill the
pending signal queue, do you start dropping signals?
Hm. Yeah, that's tough. If you have a 32-bit and 64-bit process
reading from the same signalfd source, would you expect them to return
the same format or different?
J
-