While I wanted to object to your findings and restore the child code to
use sigaction() as I originally wrote it, I also changed the pause()
function with sigsuspend() as suggested. Surprisingly, everything
started working correctly. That means that pause() causes problems. Any
idea why?
Still I don't understand how come the shell restarts the process (manual
activation of course) with the code below.


Oron Peled wrote:

On Monday 31 January 2005 00:01, guy keren wrote:


On Sun, 30 Jan 2005, David Harel wrote:


signal(SIGALRM, sigalrmHandler);


a-ha! and since when do you use 'signal' in a portable program, that's
supposed to have a persistent signal handler?

read 'man 2 signal', and look at the portability notes.

then read 'man 2 sigaction', and use sigaction() instead of signal().



while(1)
pause();



Just to complete the correct answer by guy, pause should be replaced with sigsuspend (Hmmm... how nice, on Linux it is in the same man page as sigaction so you probably know it by now).

Further reading: the "Reliable signal handling" in the late Richard
Stevens book (Advanced Programming in the Unix Environment).




-- Thanks.

David Harel,

==================================

Home office +972 4 6921986
Fax:        +972 4 6921986
Cellular:   +972 54 4534502
Snail Mail: Amuka
           D.N Merom Hagalil
           13802
           Israel
Email:      [EMAIL PROTECTED]



=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Reply via email to