delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/18/05:21:07

Date: Thu, 18 May 2000 11:28:27 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp AT delorie DOT com
Subject: Re: Porting from DJGPP C to FreePascal: Problem with signals
In-Reply-To: <036e48e6.0809ece7@usw-ex0108-062.remarq.com>
Message-ID: <Pine.SUN.3.91.1000518112805.12245E-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019