Signal handling possibly wrong
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 9 lines · * Steven Rostedt ([email protected]) wrote:
Quoted 5 lines
Where,
sa_maskis _ignored_ if NODEFER is set. (I now have woken up!). The attached program shows that thesa_maskis indeed ignored whenSA_NODEFERis set.Now the real question is... Is this a bug?
That's not correct w.r.t. SUSv3.
sa_maskshould be always used andSA_NODEFERis just whether or not to add that signal in.
Yes.
Quoted 6 lines
SA_NODEFER
[XSI] If set and sig is caught, sig shall not be added to the thread's
signal mask on entry to the signal handler unless it is included insa_mask. Otherwise, sig shall always be added to the thread's signal mask on entry to the signal handler.
It's amazing that this non-conformance was never spotted before. It seems to go all the way back to kernel 1.0 (when the flag was known as SA_NOMASK).
I'll get something into the manual pages under BUGS.
Cheers,
Michael
Signature · 6 lines
Michael Kerrisk maintainer of Linux man pages Sections 2, 3, 4, 5, and 7 Want to help with man page maintenance? Grab the latest tarball at ftp://ftp.win.tue.nl/pub/linux-local/manpages/ and grep the source files for 'FIXME'.