Man Page signal.3f




NAME

     signal - change the action for a signal


SYNOPSIS

     integer*4 function signal(signum, proc, flag)
     integer*4 signum, flag
     external proc

     For 64-bit environments:
     integer*8 function signal(signum, proc, flag)

     When compiling for 64-bit environments, with compiler option
     -xarch=v9,  signal must be declared integer*8 signal as well
     as any variables receiving the result from signal.


DESCRIPTION

     If a process incurs a signal (see  signal(3)),  the  default
     action  is usually to clean up and abort.  You can choose to
     write an alternative signal handling  routine.   A  call  to
     signal  is the way this alternate action is specified to the
     system.

     Input:
      signum is the signal number (see signal(3)).
      proc is the name of a user signal handling routine.
      If flag is negative, then proc must be the name of the user
      signal handling routine.
      If flag is zero or positive, then proc is ignored  and  the
      value  of flag is passed to the system as the signal action
      definition.  In particular, this is  how  previously  saved
      signal actions can be restored.
      Two possible values for flag have specific meanings:
       0 means "use the default action."  See NOTES below.
       1 means "ignore this signal."

     Output:
      A positive returned value is the  previous  action  defini-
      tion.
      A value greater than 1 is the address of a routine that was
      to have been called on occurrence of the given signal.
      A negative returned value is the negation of a system error
      code.  See perror(3F).
      The returned value can be used in subsequent calls to  sig-
      nal to restore a previous action definition.


FILES

     libF77.a


SEE ALSO

     kill(1), signal(3c), kill(3F)



NOTES

     f77 arranges to trap  certain  signals  when  a  process  is
     started.   The only way to restore the default f77 action is
     to save the returned value from the first call to signal.

     If the user signal handler is called, it is passed the  sig-
     nal number as an integer argument.