diff options
author | rsc <devnull@localhost> | 2005-01-13 04:49:19 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-01-13 04:49:19 +0000 |
commit | c8b6342d3c2a167dec16931815926e9e4387e7ef (patch) | |
tree | 80d3ec6ea074462b30639168113def880476dad6 /man/man3/setjmp.3 | |
parent | 741f510ce758f77ed5193256fb693a09a7daecce (diff) | |
download | plan9port-c8b6342d3c2a167dec16931815926e9e4387e7ef.tar.gz plan9port-c8b6342d3c2a167dec16931815926e9e4387e7ef.tar.bz2 plan9port-c8b6342d3c2a167dec16931815926e9e4387e7ef.zip |
Many small edits.
Diffstat (limited to 'man/man3/setjmp.3')
-rw-r--r-- | man/man3/setjmp.3 | 51 |
1 files changed, 21 insertions, 30 deletions
diff --git a/man/man3/setjmp.3 b/man/man3/setjmp.3 index e2af5597..1210c171 100644 --- a/man/man3/setjmp.3 +++ b/man/man3/setjmp.3 @@ -55,36 +55,6 @@ argument should be the first argument passed to the note handler. and .I longjmp can also be used to switch stacks. -Defined in -.B </$objtype/u.h> -are several macros that can be used to build -.B jmp_bufs -by hand. The following code establishes a -.B jmp_buf -.i label -that may be called by -.I longjmp -to begin execution in a function -.BR f -with 1024 bytes of stack: -.IP -.EX -#include <u.h> -#include <libc.h> - -jmp_buf label; -#define NSTACK 1024 -char stack[NSTACK]; - -void -setlabel(void) -{ - label[JMPBUFPC] = ((ulong)f+JMPBUFDPC); - /* -2 leaves room for old pc and new pc in frame */ - label[JMPBUFSP = - (ulong)(&stack[NSTACK-2*sizeof(ulong*)]); -} -.EE .SH SOURCE .B \*9/src/lib9/jmp.c .SH SEE ALSO @@ -94,3 +64,24 @@ setlabel(void) .I Notejmp cannot recover from an address trap or bus error (page fault) on the 680x0 architectures. +.PP +To avoid name conflicts with the underlying system, +.IR setjmp , +.IR longjmp , +.IR notejmp , +and +.I jmp_buf +are preprocessor macros defined as +.IR p9setjmp , +.IR p9longjmp , +.IR p9notejmp , +and +.IR p9jmp_buf ; +see +.IR intro (3). +.PP +.I P9setjmp +is implemented as a preprocessor macro that calls +.I sigsetjmp +(see +Unix's \fIsetjmp\fR(3)). |