On Sun, 30 Jan 2005, David Harel wrote:

> #include <errno.h>
>
> #include <unistd.h>
> #include <signal.h>
>
> #include <stdlib.h>
>
> void sigalrmHandler(int gotsig)
> {
>   kill(getppid(), SIGUSR1);
>   alarm(2);
> }
>
> int main(int argc, char ** argv)
> {
>   alarm(2);
>   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();
>   exit(0);
> }

-- 
guy

"For world domination - press 1,
 or dial 0, and please hold, for the creator." -- nob o. dy

=================================================================
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