# sigsetjmp

## 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.
    


## NAME



           sigsetjmp — set jump point for a non-local goto
    


## SYNOPSIS



           #include <setjmp.h>
    
           int sigsetjmp(sigjmp_buf _env_ , int _savemask_);
    


## DESCRIPTION



           The _sigsetjmp_() function shall be equivalent to the _setjmp_()
           function, except as follows:
    
            *  References to _setjmp_() are equivalent to _sigsetjmp_().
    
            *  References to _longjmp_() are equivalent to _siglongjmp_().
    
            *  If the value of the _savemask_ argument is not 0, _sigsetjmp_()
               shall also save the current signal mask of the calling thread
               as part of the calling environment.
    


## RETURN VALUE



           If the return is from a successful direct invocation, _sigsetjmp_()
           shall return 0. If the return is from a call to _siglongjmp_(),
           _sigsetjmp_() shall return a non-zero value.
    


## ERRORS



           No errors are defined.
    
           _The following sections are informative._
    


## EXAMPLES



           None.
    


## APPLICATION USAGE



           The distinction between _setjmp_()/_longjmp_() and
           _sigsetjmp_()/_siglongjmp_() is only significant for programs which
           use _sigaction_(), _sigprocmask_(), or _sigsuspend_().
    
           Note that since this function is defined in terms of _setjmp_(), if
           _savemask_ is zero, it is unspecified whether the signal mask is
           saved.
    


## RATIONALE



           The ISO C standard specifies various restrictions on the usage of
           the _setjmp_() 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 _sigsetjmp_() macro.
    
           There are processors that cannot easily support these calls, but
           this was not considered a sufficient reason to exclude them.
    
           4.2 BSD, 4.3 BSD, and XSI-conformant systems provide functions
           named __setjmp_() and __longjmp_() that, together with _setjmp_() and
           _longjmp_(), provide the same functionality as _sigsetjmp_() and
           _siglongjmp_().  On those systems, _setjmp_() and _longjmp_() save and
           restore signal masks, while __setjmp_() and __longjmp_() do not. On
           System V Release 3 and in corresponding issues of the SVID,
           _setjmp_() and _longjmp_() are explicitly defined not to save and
           restore signal masks. In order to permit existing practice in both
           cases, the relation of _setjmp_() and _longjmp_() to signal masks is
           not specified, and a new set of functions is defined instead.
    
           The _longjmp_() and _siglongjmp_() functions operate as in the
           previous issue provided the matching _setjmp_() or _sigsetjmp_() 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.
    


## FUTURE DIRECTIONS



           None.
    


* * *