Penguin
Annotated edit history of longjmp(3) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 LONGJMP
2 !!!LONGJMP
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 RETURN VALUE
7 CONFORMING TO
8 NOTES
9 SEE ALSO
10 ----
11 !!NAME
12
13
14 longjmp, siglongjmp - non-local jump to a saved stack context
15 !!SYNOPSIS
16
17
18 __#include __
19
20
21 void longjmp(jmp_buf ''env''__, int__ ''val''__);
22 void siglongjmp(sigjmp_buf__ ''env''__, int__ ''val''__);
23 __
24 !!DESCRIPTION
25
26
27 __longjmp()__ and __setjmp()__ are useful for dealing
28 with errors and interrupts encountered in a low-level
29 subroutine of a program. __longjmp()__ restores the
30 environment saved by the last call of __setjmp()__ with
31 the corresponding ''env'' argument. After
32 __longjmp()__ is completed, program execution continues
33 as if the corresponding call of __setjmp()__ had just
34 returned the value ''val''. __longjmp()__ cannot cause
35 0 to be returned. If longjmp is invoked with a second
36 argument of 0, 1 will be returned instead.
37
38
39 __siglongjmp()__ is similar to __longjmp()__ except
40 for the type of its ''env'' argument. If the
41 __sigsetjmp()__ call that set this ''env'' used a
42 nonzero ''savesigs'' flag, __siglongjmp()__ also
43 restores the set of blocked signals.
44 !!RETURN VALUE
45
46
47 These functions never return.
48 !!CONFORMING TO
49
50
51 POSIX
52 !!NOTES
53
54
55 POSIX does not specify whether __longjmp__ will restore
56 the signal context. If you want to save and restore signal
57 masks, use __siglongjmp__.
58
59
60 __longjmp()__ and __siglongjmp()__ make programs hard
61 to understand and maintain. If possible an alternative
62 should be used.
63 !!SEE ALSO
64
65
66 setjmp(3), sigsetjmp(3)
67 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.