*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> siglongjmp (3)              
Title
Content
Arch
Section
 

sigsetjmp(3)

Contents


NAME    [Toc]    [Back]

       sigsetjmp, siglongjmp - Save and restores the current execution
 context

SYNOPSIS    [Toc]    [Back]

       #include <setjmp.h>

       int sigsetjmp(
               sigjmp_buf environment,
               int savemask ); void siglongjmp(
               sigjmp_buf environment,
               int value );

LIBRARY    [Toc]    [Back]

       Standard C Library (libc)

STANDARDS    [Toc]    [Back]

       Interfaces documented on this reference  page  conform  to
       industry standards as follows:

       siglongjmp(), sigsetjmp(): XPG4, XPG4-UNIX

       Refer to the standards(5) reference page for more information
 about industry standards and associated tags.

PARAMETERS    [Toc]    [Back]

       Specifies an address for a sigjmp_buf  structure.   Specifies
  whether  the current signal mask should be saved. If
       this parameter contains a 0 (zero) value, sigsetjmp() does
       not  save  the  signal mask. Otherwise, the function saves
       the signal mask.  Specifies the value you want written  to
       the   execution   context  as  the  return  value  of  the
       sigsetjmp() function. If you  specify  0  (zero)  in  this
       parameter,  the execution context contains a value of 1 as
       the sigsetjmp() return value. See the RETURN  VALUES  section
 for more information.

DESCRIPTION    [Toc]    [Back]

       The sigsetjmp() and siglongjmp() functions are useful when
       handling errors and interrupts  encountered  in  low-level
       functions of a program.

       The  sigsetjmp()  function saves the current stack context
       in the buffer specified by the environment  parameter.  If
       the  value  of the savemask parameter is not 0 (zero), the
       sigsetjmp() function also saves the process' current  signal
 mask as part of the calling environment.

       You  use the buffer specified by the environment parameter
       in a later call to the siglongjmp()  function.   The  siglongjmp()
 function restores the stack context and (optionally)
 signal mask that were saved by the sigsetjmp() function.


       After  the  siglongjmp()  function runs, program execution
       continues as if the corresponding call to the  sigsetjmp()
       function  had just returned the value of the value parameter.
  The function that called  the  sigsetjmp()  function
       must  not  have returned before the completion of the siglongjmp()
 function.

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

RETURN VALUES    [Toc]    [Back]

       After the siglongjmp()  function  is  finished  executing,
       program  execution  continues as if the corresponding call
       of the sigsetjmp() function just returned. In other words,
       the   execution   context   saved   by  the  corresponding
       sigsetjmp() function is in place and  execution  continues
       at  the  statement  immediately  following the call to the
       sigsetjmp() function.

       Part of that execution context is the  return  value  from
       the  sigsetjmp()  function.  When the sigsetjmp() function
       actually returns (before  the  call  to  the  siglongjmp()
       function),  that  return  value is 0 (zero). When the siglongjmp()
 function returns, the execution context contains
       a  non-zero value as the return value from the sigsetjmp()
       function.

       The value you specify in the value parameter to  the  siglongjmp()
  function is written to the execution context as
       the return value for the sigsetjmp() function.  You cannot
       cause  the  execution  context to contain a 0 (zero) value
       for the sigsetjmp() return value. If you specify 0 in  the
       value parameter, the execution context contains a 1 as the
       sigsetjmp() return value.

CAUTION    [Toc]    [Back]

       The results of the siglongjmp() function are undefined  if
       one of the following is true: The siglongjmp() function is
       called with an environment parameter that was  not  previously
  set  by  the sigsetjmp() function The function that
       made the corresponding call to  the  sigsetjmp()  function
       has already returned.

       If  the  siglongjmp() function detects one of these conditions,
 it calls the longjmperror() function. If longjmperror()
 returns, the program is aborted. The default version
       of longjmperror() displays an error  message  to  standard
       error  and  returns. If you want your program to exit more
       gracefully, you can write your own version of the  longjmperror()
 program.

SEE ALSO    [Toc]    [Back]

      
      
       Routines: setjmp(3)

       Standards: standards(5)



                                                     sigsetjmp(3)
[ Back ]
 Similar pages
Name OS Title
getcontext Tru64 Initiates and restores user level context switching
setcontext Tru64 Initiates and restores user level context switching
setjmp Linux save stack context for non-local goto
glciscontext IRIX test whether a context ID is the current GLC context
sched_rr_get_interval Tru64 Returns the current quantum for process execution under the SCHED_RR policy (P1003.1b)
getcontext IRIX get and set current user context
glXGetCurrentContext Tru64 return the current context
getcontext HP-UX get and set current user context
glcgetcurrentcontext IRIX return current context ID
glXGetCurrentDisplay Tru64 get display for current context
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service