I'm trying to verify my understanding of the signal specifications.

On the signal.h man page SA_RESETHAND is defined as:
Causes signal dispositions to be set to SIG_DFL on entry to signal handlers
On the sigaction() man page action of SA_RESETHAND is defined:
If set, the disposition of the signal shall be reset to SIG_DFL and the 
SA_SIGINFO flag shall be cleared on entry to the signal handler.

My questions are:

1)     When using a signal handler defined by sa_handler should signal(2) 
return SIG_DFL for the old signal value?

2)     When using a signal handler defined by sa_handler or sa_sigaction should 
the signal handler value returned  in oact by the call sigaction(sig, NULL, 
&oact) be set to SIG_DFL?

3)     When using a handler defined by sa_sigaction should the sa_flags value 
returned in oact by the call: sigaction(sig, NULL, &oact) not have SA_SIGINFO 
set?

My tests on different versions of UNIX indicate

1)     SIG_DFL is not always set on entry to signal handlers when the 
SA_RESETHAND flag is set via sigaction(2)

2)     The SA_SIGINFO flag is not cleared when returned by sigaction(2) when 
used in the signal handler.

Thank you for clarifying my understanding of the specification.


Reply via email to