SIGNAL(2)           Linux Programmer's Manual           SIGNAL(2)

       signal - ANSI C signal handling

       #include <signal.h>


       The  signal  system call installs a new signal handler for
       the signal with number signum.  The signal handler is  set
       to  handler which may be a user specified function, or one
       of the following:

                     Ignore the signal.

                     Reset the signal to its default behavior.

       The integer argument that is handed  over  to  the  signal
       handler routine is the signal number. This makes it possi-
       ble to use one signal handler for several signals.

       signal returns the previous value of the  signal  handler,
       or SIG_ERR on error.

       Signal handlers cannot be set for SIGKILL or SIGSTOP.

       Unlike  on  BSD  systems, signals under Linux are reset to
       their default  behavior  when  raised.   However,  if  you
       include  <bsd/signal.h>  instead of <signal.h> then signal
       is redefined as __bsd_signal and signal has the BSD seman-
       tics.   Both versions of signal are library routines built
       on top of sigaction(2).

       If you're confused by the prototype at  the  top  of  this
       manpage, it may help to see it separated out thus:

       typedef void (*sighandler_t)(int);
       sighandler_t signal(int signum, sighandler_t handler);

       According  to  POSIX,  the behaviour of a process is unde-
       fined after it ignores a SIGFPE, SIGILL, or SIGSEGV signal
       that  was not generated by the kill() or the raise() func-
       tions.  Integer division by zero has undefined result.  On
       some  architectures  it  will  generate  a  SIGFPE signal.
       (Also dividing the most negative integer by -1 may  gener-
       ate  SIGFPE.)   Ignoring this signal might lead to an end-
       less loop.

       According to POSIX (B. you must not set the action
       for  SIGCHLD  to SIG_IGN. Here the BSD and SYSV behaviours
       differ, causing BSD software  that  sets  the  action  for
       SIGCHLD to SIG_IGN to fail on Linux.

       ANSI C

       tion(2), signal(7), sigsetops(3), sigvec(2), alarm(2).

Linux 2.0                  21 July 1996                         1