Factbites
 Where results make sense
About us   |   Why use us?   |   Reviews   |   PR   |   Contact us  

Topic: Setjmp


  
  avr-libc: <setjmp.h>: Non-local goto
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 __jmpb for later use by longjmp().
setjmp() returns 0 if returning directly, and non-zero when returning from longjmp() using the saved context.
www.nongnu.org /avr-libc/user-manual/group__setjmp.html   (260 words)

  
 Manual page for setjmp(3C)
setjmp() saves its stack environment in env for later use by longjmp().
At the time of the second return from setjmp(), all external and static variables have values as of the time longjmp() is called (see example).
getcontext(2) priocntl(2) sigaction(2) sigaltstack(2) sigprocmask(2) signal(3c) warnings if longjmp() or siglongjmp() are called even though env was never primed by a call to setjmp() or sigsetjmp(), or when the last such call was in a function that has since returned, absolute chaos is guaranteed.
www.cs.utk.edu /~cs460.is&r/cgi-bin/group4/collection/sigsetjmp.3c.html   (496 words)

  
 setjmp.h   (Site not responding. Last check: 2007-10-21)
The routine that calls setjmp and sets up j_buf must still be active and cannot have returned before the longjmp is called.
setjmp is useful for dealing with errors and exceptions encountered in a low-level subroutine of a program.
If the return is from a call to longjmp, setjmp returns a nonzero value.
tigcc.ticalc.org /doc/setjmp.html   (259 words)

  
 Setjmp and Longjmp   (Site not responding. Last check: 2007-10-21)
In order to jump directly to another (non-local) function, the C library provides the setjmp() and longjmp() functions.
setjmp() and longjmp() make programs hard to understand and maintain.
Value to return to the caller of setjmp().
jubal.westnet.com /AVR/doc/avr-libc-user-manual/group__setjmp.html   (241 words)

  
 setjmp   (Site not responding. Last check: 2007-10-21)
A call to setjmp(), saves the calling environment in its env argument for later use by longjmp().
It is unspecified whether setjmp() is a macro or a function.
All accessible objects have values as of the time longjmp() was called, except that the values of objects of automatic storage duration which are local to the function containing the invocation of the corresponding setjmp() which do not have volatile-qualified type and which are changed between the setjmp() invocation and longjmp() call are indeterminate.
www.opengroup.org /onlinepubs/007908799/xsh/setjmp.html   (260 words)

  
 Technical Reference: Base Operating System and Extensions , Volume 2 - setjmp or longjmp Subroutine
The setjmp subroutine and the longjmp subroutine are useful when handling errors and interrupts encountered in low-level subroutines of a program.
The setjmp subroutine returns a value of 0, unless the return is from a call to the longjmp function, in which case setjmp returns a nonzero value.
Attention: If the longjmp subroutine is called with a Context parameter that was not previously set by the setjmp subroutine, or if the subroutine that made the corresponding call to the setjmp subroutine has already returned, then the results of the longjmp subroutine are undefined.
www.ncsa.uiuc.edu /UserInfo/Resources/Hardware/IBMp690/IBM/usr/share/man/info/en_US/a_doc_lib/libs/basetrf2/setjmp.htm   (454 words)

  
 setjmp(3)
The setjmp() and longjmp() functions are useful when handling errors and interrupts encountered in low-level functions of a program.
However, if the longjmp() 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.
When the setjmp() function actually returns (before the call to the longjmp() function), that return value is 0 (zero).
www.helsinki.fi /atk/unix/dec_manuals/DOC_51/HTML/MAN/MAN3/0030____.HTM   (646 words)

  
 Cal Poly Central UNIX man pages : setjmp ()   (Site not responding. Last check: 2007-10-21)
setjmp() saves its stack environment in env (whose type, jmp_buf, is defined in the header file) for later use by longjmp().
Upon the return from a setjmp() call caused by a longjmp(), the values of any non-static local variables belonging to the routine from which setjmp() was called are undefined.
The conditions under which the environment of the setjmp() no longer exists include exiting the procedure that contains the setjmp() call, and exiting an inner block with temporary storage (such as a block with declarations in C or a with statement in Pascal).
www.calpoly.edu /cgi-bin/man-cgi?setjmp   (723 words)

  
 UNIX man pages : setjmp (3UCB)   (Site not responding. Last check: 2007-10-21)
The setjmp() and longjmp() functions are useful for dealing with errors and interrupts encountered in a low-level sub- routine of a program.
The setjmp() and longjmp() functions save and restore the signal mask while _setjmp() and _longjmp() manipulate only the C stack and registers.
The setjmp() function does not save the current notion of whether the process is executing on the signal stack.
www.pmel.noaa.gov /epic-bin/man-cgi?setjmp+3UCB+1234   (516 words)

  
 setjmp(3) - Plan 9 from User Space   (Site not responding. Last check: 2007-10-21)
The invoker of setjmp must not itself have returned in the interim.
Setjmp and longjmp can also be used to switch stacks.
To avoid name conflicts with the underlying system, setjmp, longjmp, notejmp, and jmp_buf are preprocessor macros defined as p9setjmp, p9longjmp, p9notejmp, and p9jmp_buf; see intro(3).
swtch.com /plan9port/man/man3/setjmp.html   (180 words)

  
 SETJMP - prepare for non-local GOTO.   (Site not responding. Last check: 2007-10-21)
"setjmp" is used in connection with the "longjmp" function.
This time though when the "setjmp" returns, the value it returns is the "value" specified in the call to "longjmp".
When the "setjmp" is executed the first time, it saves the environment in "env" and returns a zero.
www.thinkage.on.ca /english/gcos/expl/c/lib/setjmp.html   (357 words)

  
 nlibc: setjmp.h Source File   (Site not responding. Last check: 2007-10-21)
If the return is from a call to any of the 00046 longjmps, all setjmp routines return a nonzero value.
After the longjmp is completed, 00050 program execution continues as if the corresponding call of setjmp (which 00051 must not itself have returned in the interim) had just returned the value 00052 val.
At the time of the second return from a setjmp, external and 00055 static variables have values as of the time longjmp is called (see 00056 example).
www.physik.uni-bielefeld.de /~okacz/nlibc/setjmp_8h-source.html   (400 words)

  
 setjmp / longjmp   (Site not responding. Last check: 2007-10-21)
Since restoring the jmp_buf replaces the stack pointer and program counter, the stack is unwound and the program returns to the site of the setjmp call, this time with a non-zero return value from setjmp.
We then search for all calls to setjmp and longjmp and replace them with functions that properly maintain the shadow stack pointer in addition to the registers in jmp_buf.
This transformation is necessary because a thread's state in Scrash is described by the contents of the registers, stack pointer, and shadow stack pointer, all of which must be stored in jmp_buf for longjmp to work properly.
www.usenix.org /publications/library/proceedings/sec03/tech/full_papers/broadwell/broadwell_html/node16.html   (299 words)

  
 SETJMP(3) Linux Manual Page
setjmp() saves the stack context/environment in env for later use by longjmp().
setjmp() and sigsetjmp() return 0 if returning directly, and non-zero when returning from longjmp() using the saved context.
setjmp() and sigsetjmp make programs hard to understand and maintain.
jamesthornton.com /linux/man/sigsetjmp.3.html   (140 words)

  
 Manual Lookup for 'setjmp.3'
SETJMP(3) Library functions SETJMP(3) 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 inter- rupts encountered in a low-level subroutine of a program.
If savesigs is non-zero, the set of blocked signals is saved in env and will be restored if a sig- longjmp() 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.
www.cse.unsw.edu.au /scripts/man?setjmp.3   (211 words)

  
 KCGL1 Help CRTL setjmp Description   (Site not responding. Last check: 2007-10-21)
If longjmp is then called, naming the same environment as the call to setjmp, control is returned to the setjmp call as if it had returned normally a second time.
To preserve the true value of setjmp, the function calling setjmp must not be called again until the associated longjmp is called.
The setjmp and longjmp functions rely on the OpenVMS condition- handling facility to effect a nonlocal goto with a signal handler.
www.montagar.com /HELP/CRTL/SETJMP/DESCRIPTION   (276 words)

  
 [No title]   (Site not responding. Last check: 2007-10-21)
As I mentioned, I'll probably try to implement this in macros and/or templates for C++ (I've already got the exception part, I just need the resume part), and presumably could do something similar in D (as long as setjmp/longjmp are available).
All they would have had to do was disallow optimization across a setjmp() call and the problem would go away (setjmp saves the entire stack and longjmp restores the entire stack, so all the local variables are correct in memory -- it is only the incorrectly optimized register copies that can be wrong).
It seems like you should be able to disable optimizations, or flush gunk through the registers after setjmp returns (slows it down slightly, but it would be worth it for a guarantee of correctness), or something else.
www.digitalmars.com /drn-bin/wwwnews?D/8498   (514 words)

  
 [No title]   (Site not responding. Last check: 2007-10-21)
The longjmp() function restores the stack context and signal mask that were saved by the setjmp() function in the corresponding environment buffer.
NOTES The reentrant versions of the setjmp() and longjmp() func- tions are identical in behavior to the _setjmp() and _longjmp() The System V versions of the setjmp() and longjmp() func- tions, which are equivalent to _setjmp() and _longjmp() respectively, are also supported for compatibility.
RETURN VALUES The setjmp() function returns a value of 0 (zero), unless the return is from a call to the longjmp() function, in which case setjmp() returns a nonzero value.
www.sandia.gov /ASCI/Red/usage/paragon/man/man3/setjmp.3.html   (589 words)

  
 setjmp
A call to setjmp() shall save the calling environment in its env argument for later use by
If a macro definition is suppressed in order to access an actual function, or a program defines an external identifier with the name setjmp, the behavior is undefined.
If the return is from a direct invocation, setjmp() shall return 0.
www.opengroup.org /onlinepubs/007904875/functions/setjmp.html   (297 words)

  
 ! Aware to man pages: setjmp(3)
Pairs of calls may be intermixed; i.e., both sigsetjmp() and siglongjmp() as well as setjmp() and longjmp() combinations may be used in the same program.
However, individual calls may not -- e.g., the env argument to setjmp() may not be passed to siglongjmp().
All accessible objects have values as of the time longjmp() routine was called, except that the values of objects of automatic storage invocation duration that do not have the volatile type and have been changed between the setjmp() invocation and longjmp() call are indeterminate.
www.rocketaware.com /man/man3/setjmp.3.htm   (465 words)

  
 manquery - -s 3c setjmp @ Eastern Illinois University   (Site not responding. Last check: 2007-10-21)
The setjmp() function saves its stack environment in env for later use by longjmp().
After longjmp() is completed, program execution continues as if the corresponding invocation of setjmp() had just returned the value specified by val.
The longjmp() function cannot cause setjmp() to return 0; if val is 0, setjmp() returns 1.
www.eiu.edu /cgi-bin/manquery?setjmp(3c)   (639 words)

  
 libunwind-setjmp(3)
Typically, just 2 or 3 words need to be saved in the jump-buffer (plus one call to sigprocmask(2), in the case of sigsetjmp).
In fact, the time spent on a longjmp() will be proportional to the number of call frames that exist between the points where setjmp() and longjmp() were called.
library is beneficial primarily in applications that frequently call setjmp() but only rarely call longjmp().
www.hpl.hp.com /research/linux/libunwind/man/libunwind-setjmp(3).php   (258 words)

  
 setjmp   (Site not responding. Last check: 2007-10-21)
setjmp and longjmp(3) are useful for dealing with errors and interrupts encountered in a low-level subroutine of a program.
It returns the value 0 if returning directly and non-zero when returning from longjmp() using the saved context.
setjmp() makes programs hard to understand and maintain.
www.phim.unibe.ch /comp_doc/c_manual/C/MAN/setjmp.htm   (110 words)

  
 setjmp (Visual C++ Libraries)
If setjmp returns as a result of a longjmp call, it returns the value argument of longjmp, or if the value argument of longjmp is 0, setjmp returns 1.
When used together, setjmp and longjmp provide a way to execute a nonlocal goto.
They are typically used to pass execution control to error-handling or recovery code in a previously called routine without using the normal calling or return conventions.
msdn.microsoft.com /library/en-us/vclib/html/_CRT_setjmp.asp?frame=true   (207 words)

  
 UNIX man pages : setjmp ()
The longjmp() function cannot cause setjmp() to return the value 0.
Example 1: Example of setjmp() and longjmp() functions.
If longjmp() or siglongjmp() are called even though env was never primed by a call to setjmp() or sigsetjmp(), or when the last such call was in a function that has since returned, the results are undefined.
www.lehman.cuny.edu /cgi-bin/man-cgi?setjmp   (621 words)

  
 C51: USING SETJMP AND LONGJMP WITH CODE BANKING AND RTX51
The setjmp and longjmp functions may be used in code banking programs as long as the setjmp and longjmp target located within the same code bank or the common area.
Additionally, the setjmp and longjmp target must be located in the same task context.
It is not safe to use setjmp and longjmp with RTX51 Tiny since this operating system performs dynamic stack swapping.
www.keil.com /support/docs/2472.htm   (170 words)

  
 UNIX man pages : setjmp (3C)   (Site not responding. Last check: 2007-10-21)
If siglongjmp() is invoked with a second argument of 0, sig- setjmp() will return 1.
If the return is from a direct invocation, setjmp() and sig- setjmp() return 0.
was never primed by a call to setjmp() or sigsetjmp(), or when the last such call was in a function that has since returned, the results are undefined.
www.cs.duke.edu /cgi-bin/man2.cgi?setjmp+3C+1   (569 words)

  
 setjmp - Man Pages at IceWalkers.com
SETJMP(3) Library functions SETJMP(3) NAME setjmp, sigsetjmp - save stack context for non-local goto SYNOPSIS #include intsetjmp(jmp_buf env); intsigsetjmp(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.
RETURNVALUE setjmp() and sigsetjmp() return 0 if returning directly, and non-zero when returning from longjmp() using the saved context.
Main reason to upgrade to kernel 2.6 is improved...
www.icewalkers.com /Linux/ManPages/setjmp-3.html   (169 words)

  
 OpenVMS ask the wizard - DEC C setjmp/longjmp status values?   (Site not responding. Last check: 2007-10-21)
I wrote a C program which uses the functions setjmp and longjmp.
If the second argument of longjmp is 0 then the setjmp function returned 1.
The second parameter to longjmp and decc$fast_longjmp is the return status for the setjmp call.
h71000.www7.hp.com /wizard/wiz_1008.html   (199 words)

  
 Libpng: writing PNG files... - GameDev.Net Discussion Forums   (Site not responding. Last check: 2007-10-21)
And for some unknown reason, the setjmp() function you have to call, returns a nonzero value...
About setjmp(): If I understand correctly, setjmp is some kind of C exception handling system.
After you call setjmp(), if an exception happens, the library will call longjump() which will cause the point of execution back to where you called setjmp(), and make it return non-zero.
www.gamedev.net /community/forums/topic.asp?topic_id=256278   (778 words)

  
 Setjmp/longjmp - Wikipedia, the free encyclopedia
Here is how the example program described above might be set up:
#include #include #include jmp_buf main_loop; void abort_to_main_loop (int status) { longjmp (main_loop, status); } int main (void) { while (1) if (setjmp (main_loop)) puts ("Back at main loop...."); else do_command (); } void do_command (void) { char buffer[128]; if (fgets (buffer, 128, stdin) == NULL) abort_to_main_loop (-1); else exit (EXIT_SUCCESS); }
if (setjmp (BUFFER)) /* Code to clean up after premature return.
en.wikipedia.org /wiki/Setjmp/longjmp   (489 words)

Try your search on: Qwika (all wikis)

Factbites
  About us   |   Why use us?   |   Reviews   |   Press   |   Contact us  
Copyright © 2005-2007 www.factbites.com Usage implies agreement with terms.