Compaq Fortran for Tru64 UNIX Alpha Systems V5.4

signal (3f)


Syntax

  integer*4 signum, flag
  integer*8 ret, signal
  external signal, proc
  ret = signal ( signum, proc, flag )

Description

  When a process incurs a signal (see signal(3)), the default action is
  usually to clean up and abort.  A user can choose to write an alternative
  signal handling routine with a call to signal.

  The signum argument is the signal number (see signal(3)).  If the specified
  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: zero means "use the
  default action", 1 means "ignore this signal".

Restrictions

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

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

Return Values

  A positive return value is the previous action definition.  A value greater
  than 1 is the address of a routine that is to be called on occurrence of
  the given signal.  The returned value can be used in subsequent calls to
  signal in order to restore a previous action definition.  A negative return
  value is the negation of a system error code.  (See perror(3f).)

See Also

  kill(1), signal(3), kill(3f)