GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


Manpage of LONGJMP

LONGJMP

Index
 

NAME

longjmp, siglongjmp - non-local jump to a saved stack context  

SYNOPSIS

#include <setjmp.h>

void longjmp(jmp_buf env, int val);
void siglongjmp(sigjmp_buf env, int val);
 

DESCRIPTION

fBlongjmp()fP and fBsetjmp()fP are useful for dealing with errors and interrupts encountered in a low-level subroutine of a program. fBlongjmp()fP restores the environment saved by the last call of fBsetjmp()fP with the corresponding fIenvfP argument. After fBlongjmp()fP is completed, program execution continues as if the corresponding call of fBsetjmp()fP had just returned the value fIvalfP. fBlongjmp()fP cannot cause 0 to be returned. If longjmp is invoked with a second argument of 0, 1 will be returned instead. fBsiglongjmp()fP is similar to fBlongjmp()fP except for the type of its fIenvfP argument. If the fBsigsetjmp()fP call that set this fIenvfP used a nonzero fIsavesigsfP flag, fBsiglongjmp()fP also restores the set of blocked signals.  

RETURN VALUE

These functions never return.  

CONFORMING TO

POSIX  

NOTES

POSIX does not specify whether fBlongjmpfP will restore the signal context. If you want to save and restore signal masks, use fBsiglongjmpfP. fBlongjmp()fP and fBsiglongjmp()fP make programs hard to understand and maintain. If possible an alternative should be used.  

SEE ALSO

setjmp(3), sigsetjmp(3)


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
CONFORMING TO
NOTES
SEE ALSO