Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

gsignal(3c) [opensolaris man page]

ssignal(3C)						   Standard C Library Functions 					       ssignal(3C)

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) SunOS 5.11 29 Dec 1996 ssignal(3C)

Check Out this Related Man Page

ssignal(3)						     Library Functions Manual							ssignal(3)

NAME
ssignal, ssignal_r, gsignal, gsignal_r - Set and raise a software signal LIBRARY
Standard C Library (libc.a) SYNOPSIS
#include <signal.h> void *ssignal( int signal, void (*function)(int))) (int); int gsignal( int signal); The following functions are supported to maintain backward compatibility with previous versions of the operating system. void *ssignal_r( int signal, void (*function) (int), void (*sigs[])(int))) (int); int gsignal_r( int signal, void (*sigs[])(int)); PARAMETERS
Defines the signal. Specifies the action associated with the signal. Specifies the array of signal functions. This structure must have at least 21 entries, each of which must be initialized to 0 (zero) by the caller. DESCRIPTION
These functions are obsolete and are retained for compatibility with earlier versions of the operating system. The ssignal() and gsignal() functions implement a facility similar to that of the signal() function and the kill() system call. However, there is no connection between the two facilities. User programs can use the ssignal() and gsignal() functions to handle exception pro- cessing within an application. signal() and related functions handle system-defined exceptions. The signals available are associated with integers in the range 1 to 15. Other values are reserved for use by the C library and should not be used. The ssignal() function associates the procedure specified by the function parameter with the signal specified by the signal parameter. The gsignal() function raises the signal, causing the procedure specified by the function parameter to be taken. The function parameter is either a pointer to a user-defined function, or either of the constants SIG_DFL (default action) or SIG_IGN (ignore signal). The ssignal() function returns the procedure that was previously established for that signal. If no procedure was estab- lished before or if the signal number is illegal, then ssignal() returns the value SIG_DFL. The gsignal() function raises the signal specified by the signal parameter by performing the following: If the procedure for signal is SIG_DFL, the gsignal() function returns a value of 0 (zero) and takes no other action. If the procedure for signal is SIG_IGN, the gsig- nal() function returns a value of 1 and takes no other action. If the procedure for signal is a function, the function value is reset to SIG_DFL and the function is called with signal passed as its parameter. The gsignal() function returns the value returned by the calling function with a single integer argument, which is the value of signal. If the procedure for signal is illegal or if no procedure is speci- fied for that signal, gsignal() returns a value of 0 (zero) and takes no other action. NOTES
The ssignal_r() and gsignal_r() functions are the reentrant versions of the ssignal() and gsignal() functions. They are supported in order to maintain backward compatibility with previous versions of the operating system. Upon successful completion, the ssignal_r() and gsig- nal_r() functions place pointers in or retrieve pointers from the signal structure in sigs. RETURN VALUES
The ssignal() and ssignal_r() functions return the value of the previously installed function if there was one, or SIG_DFL if there was not a previously installed function. If the value of signal was illegal the ssignal() and ssignal_r() functions return SIG_DFL. The gsignal() and gsignal_r() functions return a value of 0 (zero) if the procedure for signal is illegal, or if SIG_DFL is the action for signal. The gsignal() and gsignal_r() functions return a value of 1 if the procedure for signal is SIG_IGN. If none of these are true, then the gsignal() and gsignal_r() functions return the value returned by the calling function. RELATED INFORMATION
Functions: kill(2), signal(2). delim off ssignal(3)
Man Page