Daichi Kawahata wrote:
> echo "Checking to see if signal handlers stick around..."
> $cat >try.c <<'EOCP'
> foo() {}
 
> int main()
> {
>         signal(2, foo);
>         kill(getpid(), 2);
>         kill(getpid(), 2);
>         printf("abc\n");
> }

> Is there better idea?

The check is useless. Instead of signal(), sigaction() should be used. I
don't think signal numbers are standardized either. SIGKILL could as
well have the value 2. In this case, the second kill would never be
reached regardless of the signal() implementation.

-- 
Christian

Attachment: pgpIQppFDvKii.pgp
Description: PGP signature

Reply via email to