2 .\" Copyright 1989 AT&T Copyright (c) 1998, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH SSIGNAL 3C "Dec 29, 1996"
8 ssignal, gsignal \- software signals
14 \fBvoid\fR(\fB*ssignal\fR (\fBint\fR \fIsig\fR, \fBint\fR (*\fIaction\fR)(\fBint\fR)))(\fBint\fR);
19 \fBint\fR \fBgsignal\fR(\fBint\fR \fIsig\fR);
25 The \fBssignal()\fR and \fBgsignal()\fR functions implement a software facility
26 similar to \fBsignal\fR(3C). This facility is made available to users for their
31 Software signals made available to users are associated with integers in the
32 inclusive range 1 through 17. A call to \fBssignal()\fR associates a procedure,
33 \fIaction\fR, with the software signal \fIsig\fR; the software signal,
34 \fIsig\fR, is raised by a call to \fBgsignal()\fR. Raising a software signal
35 causes the action established for that signal to be taken.
38 The first argument to \fBssignal()\fR is a number identifying the type of
39 signal for which an action is to be established. The second argument defines
40 the action; it is either the name of a (user-defined) \fIaction\fR
41 \fIfunction\fR or one of the manifest constants \fBSIG_DFL\fR (default) or
42 \fBSIG_IGN\fR (ignore). The \fBssignal()\fR function returns the action
43 previously established for that signal type; if no action has been established
44 or the signal number is illegal, \fBssignal()\fR returns \fBSIG_DFL\fR.
48 The \fBgsignal()\fR raises the signal identified by its argument, \fIsig\fR.
51 If an action function has been established for \fIsig\fR, then that action is
52 reset to \fBSIG_DFL\fR and the action function is entered with argument
53 \fIsig\fR. The \fBgsignal()\fR function returns the value returned to it by the
57 If the action for \fIsig\fR is \fBSIG_IGN\fR, \fBgsignal()\fR returns the value
58 1 and takes no other action.
61 If the action for \fIsig\fR is \fBSIG_DFL\fR, \fBgsignal()\fR returns the value
62 0 and takes no other action.
65 If \fIsig\fR has an illegal value or no action was ever specified for
66 \fIsig\fR, \fBgsignal()\fR returns the value 0 and takes no other action.
70 See \fBattributes\fR(5) for descriptions of the following attributes:
78 ATTRIBUTE TYPE ATTRIBUTE VALUE
86 \fBraise\fR(3C), \fBsignal\fR(3C), \fBattributes\fR(5)