Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ signal(2) — CX/UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

signal(3C)

kill(2)

pause(2)

ptrace(2)

sigaction(2)

sigset(2)

wait(2)

setjmp(3C)

signal(5)

kill(1)

signal(2)  —  AT&T SYSTEM V

NAME

signal − specify what to do upon receipt of a signal

SYNOPSIS

#include <signal.h>

void (∗signal (sig, func))()
int sig;
void (∗func)();

DESCRIPTION

signal provides signal management for application processes.  See signal(5) for an explanation of general signal concepts. 

signal specifies the system signal action to be taken upon receipt of a signal.  sig specifies the signal, which may be any signal except SIGKILL and SIGSTOP.  func specifies the signal’s disposition, which may be SIG_DFL, SIG_IGN, or the address of a signal handler. 

If func is SIG_DFL, the default action for signal sig is reinstated; this default is usually termination [see signal(5)].  If func is SIG_IGN the signal is subsequently ignored and pending instances of the signal are discarded.  Otherwise, the designated signal handler will be executed. 

Before entering the signal-catching function, the value of func for the caught signal will be set to SIG_DFL unless the signal is SIGILL, SIGTRAP, or SIGPWR.  Subsequent occurences of sig are not blocked during execution of the signal handler. 

For information on the signal handler interface, see signal(5). 

In general, upon return from the signal-catching handler, the receiving process will resume execution at the point it was interrupted.  However, when a signal is caught during a read(2), a write(2), an open(2), or an ioctl(2) system call on a slow device, during a pause(2) system call, or during a wait(2) system call that does not return immediately due to the existence of a previously stopped or zombie process, the signal-catching handler will be executed and then the interrupted system call may return a −1 to the calling process with errno set to EINTR. 

A call to signal cancels a pending signal sig except for a pending SIGKILL signal. 

RETURN VALUE

Upon successful completion, signal returns the previous value of the system signal action for the specified signal sig. Otherwise, a value of −1 is returned and errno is set to indicate the error. 

ERRORS

signal will fail if one or more of the following are true:

­[EINVAL] sig is an illegal signal number (including SIGKILL and SIGSTOP) or the default handling of sig cannot be changed. 

NOTES

If the disposition of SIGCHLD is set to a signal handler, SIGCHLD will not be sent when the calling process’s children are stopped or continued. 

If the disposition of SIGCHLD is set to SIG_IGN, the calling process’s child processes will not create zombie processes when they terminate [see exit(2)].  If the calling process subsequently waits for its children, it blocks until all of its children terminate; it then returns a value of −1 with errno set to ECHILD [see wait(2), sigaction(2), signal(5)]. 

In the ucb universe, the signal routine is declared to return a pointer to a function, func, that returns type int, not type void [see signal(3C)].  The proper declaration for the signal routine can be found in the <signal.h> header file. 

SEE ALSO

signal(3C), kill(2), pause(2), ptrace(2), sigaction(2), sigset(2), wait(2), setjmp(3C), signal(5). 
kill(1) in the CX/UX User’s Reference Manual. 

CX/UX Programmer’s Reference Manual

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