xref: /illumos-gate/usr/src/man/man3c/ssignal.3c (revision 598f4ceed9327d2d6c2325dd67cae3aa06f7fea6)
te
Copyright 1989 AT&T Copyright (c) 1998, Sun Microsystems, Inc. All Rights Reserved
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.
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.
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]
SSIGNAL 3C "Dec 29, 1996"
NAME
ssignal, gsignal - software signals
SYNOPSIS

#include <signal.h>

void(*ssignal (int sig, int (*action)(int)))(int);

int gsignal(int sig);
DESCRIPTION

The ssignal() and gsignal() functions implement a software facility similar to signal(3C). This facility is made available to users for their own purposes.

"ssignal(\|)"

Software signals made available to users are associated with integers in the inclusive range 1 through 17. A call to ssignal() associates a procedure, action, with the software signal sig; the software signal, sig, is raised by a call to gsignal(). Raising a software signal causes the action established for that signal to be taken.

The first argument to ssignal() is a number identifying the type of signal for which an action is to be established. The second argument defines the action; it is either the name of a (user-defined) action function or one of the manifest constants SIG_DFL (default) or SIG_IGN (ignore). The ssignal() function returns the action previously established for that signal type; if no action has been established or the signal number is illegal, ssignal() returns SIG_DFL.

"gsignal(\|)"

The gsignal() raises the signal identified by its argument, sig.

If an action function has been established for sig, then that action is reset to SIG_DFL and the action function is entered with argument sig. The gsignal() function returns the value returned to it by the action function.

If the action for sig is SIG_IGN, gsignal() returns the value 1 and takes no other action.

If the action for sig is SIG_DFL, gsignal() returns the value 0 and takes no other action.

If sig has an illegal value or no action was ever specified for sig, gsignal() returns the value 0 and takes no other action.

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
MT-Level Unsafe
SEE ALSO

raise(3C), signal(3C), attributes(5)