[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions , Volume 2


ssignal or gsignal Subroutine

Purpose

Implements a software signal facility.

Library

Standard C Library (libc.a)

Syntax

#include <signal.h>


void (*ssignal ( Signal, Action))( )
int Signal;
void (*Action)( );

int gsignal (Signal)
int Signal;

Description

Attention: Do not use the ssignal or gsignal subroutine in a multithreaded environment.

The ssignal and gsignal subroutines implement a software facility similar to that of the signal and kill subroutines. However, there is no connection between the two facilities. User programs can use the ssignal and gsignal subroutines to handle exceptional processing within an application. The signal subroutine and related subroutines handle system-defined exceptions.

The software signals available are associated with integers in the range 1 through 16. Other values are reserved for use by the C library and should not be used.

The ssignal subroutine associates the procedure specified by the Action parameter with the software signal specified by the Signal parameter. The gsignal subroutine raises the Signal, causing the procedure specified by the Action parameter to be taken.

The Action parameter is either a pointer to a user-defined subroutine, or one of the constants SIG_DFL (default action) and SIG_IGN (ignore signal). The ssignal subroutine returns the procedure that was previously established for that signal. If no procedure was established before, or if the signal number is illegal, then the ssignal subroutine returns the value of SIG_DFL.

The gsignal subroutine raises the signal specified by the Signal parameter by doing the following:

Parameters


Signal Specifies a signal.
Action Specifies a procedure.

Implementation Specifics

These subroutines are part of Base Operating System (BOS) Runtime.

Related Information

The kill or killpg subroutine, signal (sigaction, sigvec, or signal Subroutine) subroutine.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]