[ILUG] C - catching or ignoring SIGFPE

John Allen john.allen at online.ie
Tue Nov 13 10:05:07 GMT 2001


>void sigalrm_handler ()
>{
>        /* The printf(3) manpage says '%l' should print a long, or unsigned
>         * long, but I just get a '%' character instead.  So I'm using %u.
>         */
>        printf ("over %u seconds, SIGFPE was caught %u times\n",
>                alarm_secs, n_fpe);
>        _exit (0);
>}

The %l is a modifier, you need to include an i,d,p etc after the l.

Also try looking at sigprocmask() and relatives, they may work the way 
you want.






More information about the ILUG mailing list