If I call sigprocmask() first, am I guaranteed that the masked signals will queued to the signal fd when I get around to creating it?
I haven't seen the implementation, but that would be the most natural way. I don't think signals are queued to a fd at all; I think read of the fd checks for and receives pending signals, in spite of any mask (so poll checks for pending signals). And assuming it's documented with those words, there's not much room for confusion.
This mess is why sigaction(2) was invented, to allow you to set both signal of interest and signals to mask in one operation.
How does it do that? I don't think sigaction modifies the signal mask.
And you don't need it to. Where would it be useful?
However, I agree that there is no practical application of signals arbitrarily being delivered traditionally or to an fd, so except that it's extra code, it would be sensible to have signalfd() automatically block the signal class.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds