gsignal

Generates a specified software signal, which invokes the action routine established by a signal, ssignal, or sigvec function.

Format

#include  <signal.h>

int gsignal  (int sig [, int sigcode]);

Arguments

sig
The signal to be generated.
sigcode
An optional signal code. For example, signal SIGFPE-the arithmetic trap signal-has 10 different codes, each representing a different type of arithmetic trap.

The signal codes can be represented by mnemonics or numbers. The arithmetic trap codes are represented by the numbers 1 to 10, but the SIGILL codes are represented by the numbers 0 to 2. The code values are defined in the <signal.h> header file. See Tables 4-4 and 4-5 for a list of signal mnemonics, codes, and corresponding OpenVMS exceptions.

Description

Calling this function has one of the following results:

See also raise, signal, ssignal, and sigvec in this section.

See Chapter 4 for more information.

Return Values
0  Indicates a sig argument that is outside the range defined in the <signal.h> header file; errno is set to EINVAL.  
sig  Indicates that SIG_IGN (ignore signal) has been established as the action for the signal. 
x  Indicates that signal, ssignal, or sigvec has established an action function for the signal. That function is called, and its return value is returned by gsignal. 


Previous Page | Next Page | Table of Contents | Index