Annotated edit history of
sigsetjmp(3) version 1 showing authors affecting page license.
View with all changes included.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
SETJMP |
|
|
2 |
!!!SETJMP |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
RETURN VALUE |
|
|
7 |
CONFORMING TO |
|
|
8 |
NOTES |
|
|
9 |
SEE ALSO |
|
|
10 |
---- |
|
|
11 |
!!NAME |
|
|
12 |
|
|
|
13 |
|
|
|
14 |
setjmp, sigsetjmp - save stack context for non-local goto |
|
|
15 |
!!SYNOPSIS |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
__#include __ |
|
|
19 |
|
|
|
20 |
|
|
|
21 |
int setjmp(jmp_buf ''env''__); |
|
|
22 |
int sigsetjmp(sigjmp_buf__ ''env''__, int__ ''savesigs''__); |
|
|
23 |
__ |
|
|
24 |
!!DESCRIPTION |
|
|
25 |
|
|
|
26 |
|
|
|
27 |
__setjmp()__ and __longjmp()__ are useful for dealing |
|
|
28 |
with errors and interrupts encountered in a low-level |
|
|
29 |
subroutine of a program. __setjmp()__ saves the stack |
|
|
30 |
context/environment in ''env'' for later use by |
|
|
31 |
__longjmp()__. The stack context will be invalidated if |
|
|
32 |
the function which called __setjmp()__ |
|
|
33 |
returns. |
|
|
34 |
|
|
|
35 |
|
|
|
36 |
__sigsetjmp()__ is similar to __setjmp()__. If |
|
|
37 |
''savesigs'' is nonzero, the set of blocked signals is |
|
|
38 |
saved in ''env'' and will be restored if a |
|
|
39 |
__siglongjmp()__ is later performed with this |
|
|
40 |
''env''. |
|
|
41 |
!!RETURN VALUE |
|
|
42 |
|
|
|
43 |
|
|
|
44 |
__setjmp()__ and __sigsetjmp()__ return 0 if returning |
|
|
45 |
directly, and non-zero when returning from __longjmp()__ |
|
|
46 |
using the saved context. |
|
|
47 |
!!CONFORMING TO |
|
|
48 |
|
|
|
49 |
|
|
|
50 |
POSIX, ISO 9899 |
|
|
51 |
!!NOTES |
|
|
52 |
|
|
|
53 |
|
|
|
54 |
POSIX does not specify whether __setjmp__ will save the |
|
|
55 |
signal context. (In SYSV it will not. In BSD4.3 it will, and |
|
|
56 |
there is a function ___setjmp__ that will not.) If you |
|
|
57 |
want to save signal masks, use |
|
|
58 |
__sigsetjmp__. |
|
|
59 |
|
|
|
60 |
|
|
|
61 |
__setjmp()__ and __sigsetjmp__ make programs hard to |
|
|
62 |
understand and maintain. If possible an alternative should |
|
|
63 |
be used. |
|
|
64 |
!!SEE ALSO |
|
|
65 |
|
|
|
66 |
|
|
|
67 |
longjmp(3), siglongjmp(3) |
|
|
68 |
---- |
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.