Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ () — Coherent 3.1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought


signal()               COHERENT System Call              signal()




Specify disposition of a signal

#include <signal.h>
int (*signal(signum, action))()
int signum, (*action)();

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.


     SIGHUP    1    Hangup
     SIGINT    2    Interrupt
     SIGQUIT   3*   Quit
     SIGALRM   4    Alarm clock
     SIGTERM   5    Termination
     SIGREST   6    Restart indication
     SIGSYS    7*   Bad system call argument
     SIGPIPE   8    Write on closed pipe
     SIGKILL   9    Kill
     SIGTRAP   10*  Breakpoint
     SIGSEGV   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()




     SIGUNI    12*  Unimplemented instruction
     SIGPRV    13*  Privileged instruction
     SIGNVI    14*  Non-vectored interrupt
     SIGPAR    15*  Parity error


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


     SIGEPA    12*  Extended processor trap
     SIGPRV    13*  Privileged instruction
     SIGNVI    14*  Non-vectored interrupt
     SIGNMI    15*  Non-maskable interrupt (not in all versions)


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


     SIGDIVE   12*  Divide error
     SIGOVFL   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


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026