Mail Archives: djgpp/2000/05/18/05:21:07
On Wed, 17 May 2000, Bernhard Stiftner wrote:
> old_sig_int = signal(SIGINT, signal_handler); /* works OK
> */
> old_sig_kill = signal(SIGKILL, signal_handler); /* error in
> FreePascal exe */
> /* ... */
> }
>
> I wonder why all this signal stuff works except for
> SIGKILL...
This is expected behavior: you cannot install a handler for SIGKILL,
and you cannot ignore it (by using SIG_IGN). This is how Unix systems
behave, and DJGPP follows suit, by returning -1 and setting errno to
EINVAL, like Unix systems do.
It is simply non-portable to call `signal' with SIGKILL and expect
anything but a failure. Don't do that.
- Raw text -