GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SETJMP(3) FreeBSD Library Functions Manual SETJMP(3)

setjmp, longjmp, notejmp - non-local goto

#include <u.h>
#include <libc.h>

int setjmp(jmp_buf env)

void longjmp(jmp_buf env, int val)

void notejmp(void *uregs, jmp_buf env, int val)

These routines are useful for dealing with errors and interrupts encountered in a low-level subroutine of a program.

Setjmp saves its stack environment in env for later use by longjmp. It returns value 0.

Longjmp restores the environment saved by the last call of setjmp. It then causes execution to continue as if the call of setjmp had just returned with value val. The invoker of setjmp must not itself have returned in the interim. All accessible data have values as of the time longjmp was called.

Notejmp is the same as longjmp except that it is to be called from within a note handler (see The uregs argument should be the first argument passed to the note handler.

Setjmp and longjmp can also be used to switch stacks.

/src/lib9/jmp.c

Notejmp cannot recover from an address trap or bus error (page fault) on the 680x0 architectures.

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

P9setjmp is implemented as a preprocessor macro that calls sigsetjmp (see Unix's setjmp(3)).


Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.