Date: Wed, 12 Mar 1997 00:18:56 +0200 (IST) From: Eli Zaretskii To: Caspar Derksen cc: djgpp AT delorie DOT com Subject: Re: signal() and alarm() - Bug? In-Reply-To: <5g454h$lh0@hera.cs.kun.nl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On 11 Mar 1997, Caspar Derksen wrote: > With DJGPP, alarm() or signal() does not seem to work, although the > FAQ suggests that signals and alarm should work. Do you say that only based on the test program that you posted, or did yoy try using `alarm' with a real program too? Your test program will indeed prevent `alarm' and `signal' from working, because it doesn't touch any memory while it loops in `main'. In DJGPP, signals are implemented in a way that the signal handling is deferred until the program is in its main execution thread and touches some of its data. Therefore, a tight loop which doesn't access any memory is one of the two cases which will defer the signal from being delivered until you exit that loop. The other case is when your program calls a real-mode service, like some DOS function, in which case the signal handler will be called when that DOS function returns.