Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
setjmp(3)
Edit
PageHistory
Diff
Info
LikePages
SETJMP !!!SETJMP NAME SYNOPSIS DESCRIPTION RETURN VALUE CONFORMING TO NOTES SEE ALSO ---- !!NAME setjmp, sigsetjmp - save stack context for non-local goto !!SYNOPSIS __#include __ int setjmp(jmp_buf ''env''__); int sigsetjmp(sigjmp_buf__ ''env''__, int__ ''savesigs''__); __ !!DESCRIPTION __setjmp()__ and __longjmp()__ are useful for dealing with errors and interrupts encountered in a low-level subroutine of a program. __setjmp()__ saves the stack context/environment in ''env'' for later use by __longjmp()__. The stack context will be invalidated if the function which called __setjmp()__ returns. __sigsetjmp()__ is similar to __setjmp()__. If ''savesigs'' is nonzero, the set of blocked signals is saved in ''env'' and will be restored if a __siglongjmp()__ is later performed with this ''env''. !!RETURN VALUE __setjmp()__ and __sigsetjmp()__ return 0 if returning directly, and non-zero when returning from __longjmp()__ using the saved context. !!CONFORMING TO POSIX, ISO 9899 !!NOTES POSIX does not specify whether __setjmp__ will save the signal context. (In SYSV it will not. In BSD4.3 it will, and there is a function ___setjmp__ that will not.) If you want to save signal masks, use __sigsetjmp__. __setjmp()__ and __sigsetjmp__ make programs hard to understand and maintain. If possible an alternative should be used. !!SEE ALSO longjmp(3), siglongjmp(3) ----
3 pages link to
setjmp(3)
:
Man3s
longjmp(3)
siglongjmp(3)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.