This is the mail archive of the
mailing list for the Cygwin project.
Re: einval-on-wrong-args patch
Friday, 16 February, 2001 Christopher Faylor email@example.com wrote:
>> return EINVAL if signal() or lseek() are called with illegal
CF> Either your signal() change is not quite right, or sigaction() is wrong.
CF> sigaction() allows setting the handler for SIGKILL to SIG_DFL. Is
CF> that incorrect? If not, then please modify your change (and check it in).
CF> If it is the incorrect behavior, could you fix sigaction, too?
SUSv2 is a bit vague on the subject, but this program
struct sigaction act;
act.sa_handler = SIG_DFL;
act.sa_flags = 0;
act.sa_sigaction = NULL;
sigemptyset ( &act.sa_mask );
if ( signal ( SIGKILL, SIG_DFL ) == SIG_ERR ) perror ("signal" );
if ( sigaction ( SIGKILL, NULL, NULL ) ) perror ( "sigaction1" );
if ( sigaction ( SIGKILL, &act, NULL ) ) perror ( "sigaction2" );
when run on linux, prints
signal: Invalid argument
sigaction2: Invalid argument
so perhaps sigaction should be fixed. moreover, SUSv2 says that if we
add SIGKILL or SIGSTOP to sa_mask, this should be silently ignored.
Egor. mailto:firstname.lastname@example.org ICQ 5165414 FidoNet 2:5020/496.19