

signal()               COHERENT System Call              signal()




Specify disposition of a signal

#include <signal.h>
iinntt (*ssiiggnnaall(_s_i_g_n_u_m, _a_c_t_i_o_n))()
iinntt _s_i_g_n_u_m, (*_a_c_t_i_o_n)();

A process can receive a signal, or interrupt, from a hardware ex-
ception, terminal input, or  a kill call made by another process.
A hardware  exception might be  caused by an  illegal instruction
code  or  a  bad  machine  address,  caught by  the  segmentation
hardware.  A terminal interrupt character, described in detail in
tty, generates  a process interrupt (and in one  case a core dump
file for debugging purposes).

When  a process  receives a  signal,  it performs  an appropriate
action.  The  default action SIG_DFL  causes the process  to ter-
minate.   By calling  signal,  you can  specify  what action  the
process takes when it receives  a given signal signum is the num-
ber of  the signal, and  action points to the  routine to execute
when signum  is received.  The action SIG_IGN  causes a signal to
be ignored.  Note that the signal SIGKILL, which kills a process,
can be  neither caught nor ignored.  signal  returns a pointer to
the previous action.

With  the exception  of SIGILL  and  SIGTRAP, caught  signals are
reset to  the default action  SIG_DFL.  To catch  a signal again,
the specified action must reissue the signal call.

The following list  gives machine-independent signals by symbolic
name (defined  in the header  file signal.h), numeric  value, and
description.  Signals  marked by an asterisk  produce a core dump
if the action is SIG_DFL.


     SSIIGGHHUUPP    1    Hangup
     SSIIGGIINNTT    2    Interrupt
     SSIIGGQQUUIITT   3*   Quit
     SSIIGGAALLRRMM   4    Alarm clock
     SSIIGGTTEERRMM   5    Termination
     SSIIGGRREESSTT   6    Restart indication
     SSIIGGSSYYSS    7*   Bad system call argument
     SSIIGGPPIIPPEE   8    Write on closed pipe
     SSIIGGKKIILLLL   9    Kill
     SSIIGGTTRRAAPP   10*  Breakpoint
     SSIIGGSSEEGGVV   11*  Segmentation violation


The  following lists gives  machine-dependent signals  defined in
the header file msig.h.

The following signals are  specific to the Zilog Z8002 version of
COHERENT:




COHERENT Lexicon                                           Page 1




signal()               COHERENT System Call              signal()




     SSIIGGUUNNII    12*  Unimplemented instruction
     SSIIGGPPRRVV    13*  Privileged instruction
     SSIIGGNNVVII    14*  Non-vectored interrupt
     SSIIGGPPAARR    15*  Parity error


The following signals are  specific to the Zilog Z8001 version of
COHERENT:


     SSIIGGEEPPAA    12*  Extended processor trap
     SSIIGGPPRRVV    13*  Privileged instruction
     SSIIGGNNVVII    14*  Non-vectored interrupt
     SSIIGGNNMMII    15*  Non-maskable interrupt (not in all versions)


The following  signals are  specific to  the Intel 8086  or 80286
version of COHERENT:


     SSIIGGDDIIVVEE   12*  Divide error
     SSIIGGOOVVFFLL   13*  Overflow


A signal  may be  caught during  a system call  that has  not yet
returned.  In  this case, the  system call appears  to fail, with
errno set to EINTR.   If desired, such an interrupted system call
may be  reissued.  System calls which may  be interrupted in this
way include pause, read on a  device such as a terminal, write on
a pipe, and wait.

***** See Also *****

COHERENT system call, kill, ptrace(), sh, signame

***** Diagnostics *****

signal returns  a pointer to the previous  action on success.  It
returns (int)-1 for invalid signum.

















COHERENT Lexicon                                           Page 2


