.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
.TH "SIGSETJMP" 3P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
.\" sigsetjmp
.SH PROLOG
This manual page is part of the POSIX Programmer's Manual.
The Linux implementation of this interface may differ (consult
the corresponding Linux manual page for details of Linux behavior),
or the interface may not be implemented on Linux.
.SH NAME
sigsetjmp \- set jump point for a non-local goto
.SH SYNOPSIS
.LP
\fB#include <setjmp.h>
.br
.sp
int sigsetjmp(sigjmp_buf\fP \fIenv\fP\fB, int\fP \fIsavemask\fP\fB);
\fP
\fB
.br
\fP
.SH DESCRIPTION
.LP
The \fIsigsetjmp\fP() function shall be equivalent to the \fIsetjmp\fP()
function,
except as follows:
.IP " *" 3
References to \fIsetjmp\fP() are equivalent to \fIsigsetjmp\fP().
.LP
.IP " *" 3
References to \fIlongjmp\fP() are equivalent to \fIsiglongjmp\fP().
.LP
.IP " *" 3
If the value of the \fIsavemask\fP argument is not 0, \fIsigsetjmp\fP()
shall also save the current signal mask of the calling
thread as part of the calling environment.
.LP
.SH RETURN VALUE
.LP
If the return is from a successful direct invocation, \fIsigsetjmp\fP()
shall return 0. If the return is from a call to \fIsiglongjmp\fP(),
\fIsigsetjmp\fP() shall return a non-zero value.
.SH ERRORS
.LP
No errors are defined.
.LP
\fIThe following sections are informative.\fP
.SH EXAMPLES
.LP
None.
.SH APPLICATION USAGE
.LP
The distinction between \fIsetjmp\fP()/ \fIlongjmp\fP() and \fIsigsetjmp\fP()/
\fIsiglongjmp\fP() is only significant for programs which use \fIsigaction\fP(),
\fIsigprocmask\fP(), or \fIsigsuspend\fP().
.LP
Note that since this function is defined in terms of \fIsetjmp\fP(),
if \fIsavemask\fP
is zero, it is unspecified whether the signal mask is saved.
.SH RATIONALE
.LP
The ISO\ C standard specifies various restrictions on the usage of
the \fIsetjmp\fP() macro in order to permit implementors to recognize
the name in the compiler and not
implement an actual function. These same restrictions apply to the
\fIsigsetjmp\fP() macro.
.LP
There are processors that cannot easily support these calls, but this
was not considered a sufficient reason to exclude
them.
.LP
4.2 BSD, 4.3 BSD, and XSI-conformant systems provide functions named
\fI_setjmp\fP()
and \fI_longjmp\fP() that, together with \fIsetjmp\fP() and \fIlongjmp\fP(),
provide the same
functionality as \fIsigsetjmp\fP() and \fIsiglongjmp\fP(). On those
systems, \fIsetjmp\fP() and \fIlongjmp\fP() save and restore signal
masks, while \fI_setjmp\fP() and \fI_longjmp\fP() do not. On System
V Release 3 and in corresponding issues of the SVID, \fIsetjmp\fP()
and \fIlongjmp\fP() are explicitly defined
not to save and restore signal masks. In order to permit existing
practice in both cases, the relation of \fIsetjmp\fP() and \fIlongjmp\fP()
to signal masks is not
specified, and a new set of functions is defined instead.
.LP
The \fIlongjmp\fP() and \fIsiglongjmp\fP()
functions operate as in the previous issue provided the matching \fIsetjmp\fP()
or
\fIsigsetjmp\fP() has been performed in the same thread. Non-local
jumps into contexts saved by other threads would be at best a
questionable practice and were not considered worthy of standardization.
.SH FUTURE DIRECTIONS
.LP
None.
.SH SEE ALSO
.LP
\fIsiglongjmp\fP(), \fIsignal\fP(), \fIsigprocmask\fP(), \fIsigsuspend\fP(),
the Base Definitions volume of
IEEE\ Std\ 1003.1-2001, \fI<setjmp.h>\fP
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. In the
event of any discrepancy between this version and the original IEEE and
The Open Group Standard, the original IEEE and The Open Group Standard
is the referee document. The original Standard can be obtained online at
http://www.opengroup.org/unix/online.html .
|