.TH signame "" "" "Global Variable"
.PC "Array of names of signals"
.B "#include <signal.h>"
.B "extern char *signame[_SIGNAL_MAX];"
.PP
.R
When a program terminates abnormally,
its parent process receives a byte of termination information
from the system call
.BR wait() .
This byte contains a signal number, as defined in the header file
.BR signal.h .
For example,
.B SIGINT
indicates an interrupt from the terminal.
.PP
The array
.BR signame ,
indexed by signal number, contains strings that
give the meaning of each signal.
Thus,
.B "signame[SIGINT]"
points to the string \*(QLinterrupt\*(QR.
For portability reasons,
all programs which wait on child processes
(such as the shell
.BR sh )
should use
.BR signame .
.SH Files
.B <signal.h>
.SH "See Also"
.Xr "Programming COHERENT," programmi
.Xr "sh," sh
.Xr "signal()," signal
.Xr "wait" wait.c
.SH Notes
Please note that through revision 10 of the \*(CO manual,
the signal numbers in
.B signame[\^]
were offset by one.
That is erroneous:
the signal numbers are not offset at all.
.PP
.II NSIG
.II _SIGNAL_MAX
In standard implementations of \*(UN, the manifest constant
.B NSIG
was one larger than the number of signals.
Prior to release 4.2, however, \*(CO defined
.B NSIG
as being equal to the number of signals.
Beginning with release 4.2, \*(CO defines
.B NSIG
to conform to the \*(UN usage, and introduces the manifest constant
.BR _SIGNAL_MAX ,
which is equal to the number of signals.
If your code depends upon the old definition of
.BR NSIG ,
you should replace it with
.BR _SIGNAL_MAX .
.PP
Please note that
.B signame[\^]
is obsolete, and will be removed from future releases of \*(CO.
Please do not incorporate it into new code, and you should try to remove
it from existing code.
