siglongjmp

Nonlocal goto with signal handling.

Format

#include  <setjmp.h>

void siglongjmp  (sigjmp_buf env, int value);

Arguments

env
An address for a sigjmp_buf structure.
value
A nonzero value.

Description

This function restores the environment saved by the most recent call to sigsetjmp in the same process with the corresponding sigjmp_buf argument.

All accessible objects have values when siglongjmp is called, with one exception: values of objects of automatic storage duration that changed between the sigsetjmp call and siglongjmp call are indeterminate.

Because it bypasses the usual function call and return mechanisms, siglongjmp executes correctly during interrupts, signals, and any of their associated functions. However, if you invoke siglongjmp from a nested signal handler (for example, from a function invoked as a result of a signal raised during the handling of another signal), the behavior is undefined.

The siglongjmp function restores the saved signal mask only if you initialize the env argument by a call to sigsetjmp with a nonzero savemask argument.

After siglongjmp is completed, program execution continues as if the corresponding call of sigsetjmp just returned the value specified by value. The siglongjmp function cannot cause sigsetjmp to return 0 (zero); if value is 0, sigsetjmp returns 1

See also sigsetjmp in this section.


Previous Page | Next Page | Table of Contents | Index