Date: Thu, 18 May 2000 11:28:27 +0300 (IDT) From: Eli Zaretskii 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: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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.