NEWS: Add comment about changed ABI on s390 and s390x.
[glibc.git] / sysdeps / s390 / v1-setjmp.h
bloba4a6b7640fda910c353bbd9997fd37c8cffb2389
1 /* Copyright (C) 1991-2013 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
19 * ISO C99 Standard: 7.13 Nonlocal jumps <setjmp.h>
22 #ifndef _V1_SETJMP_H
23 #define _V1_SETJMP_H 1
25 #include <features.h>
27 __BEGIN_DECLS
29 #define __V1_JMPBUF
30 #define _SETJMP_H
31 #include <bits/setjmp.h> /* Get `__jmp_buf'. */
33 #ifndef _ASM
35 #include <bits/sigset.h> /* Get `__sigset_t'. */
38 /* Calling environment, plus possibly a saved signal mask. */
39 typedef struct __v1__jmp_buf_tag
41 /* NOTE: The machine-dependent definitions of `__sigsetjmp'
42 assume that a `jmp_buf' begins with a `__jmp_buf' and that
43 `__mask_was_saved' follows it. Do not move these members
44 or add others before it. */
45 __jmp_buf __jmpbuf; /* Calling environment. */
46 int __mask_was_saved; /* Saved the signal mask? */
47 __sigset_t __saved_mask; /* Saved signal mask. */
48 } __v1__jmp_buf[1];
51 /* Store the calling environment in ENV, also saving the signal mask.
52 Return 0. */
53 extern int __v1setjmp (__v1__jmp_buf __env);
55 /* Store the calling environment in ENV, also saving the
56 signal mask if SAVEMASK is nonzero. Return 0.
57 This is the internal name for `sigsetjmp'. */
58 extern int __v1__sigsetjmp (struct __v1__jmp_buf_tag __env[1],
59 int __savemask);
61 /* Store the calling environment in ENV, not saving the signal mask.
62 Return 0. */
63 extern int __v1_setjmp (struct __v1__jmp_buf_tag __env[1]);
65 /* Jump to the environment saved in ENV, making the
66 `setjmp' call there return VAL, or 1 if VAL is 0. */
67 extern void __v1longjmp (struct __v1__jmp_buf_tag __env[1], int __val)
68 __attribute__ ((__noreturn__));
70 /* Same. Usually `_longjmp' is used with `_setjmp', which does not save
71 the signal mask. But it is how ENV was saved that determines whether
72 `longjmp' restores the mask; `_longjmp' is just an alias. */
73 extern void __v1_longjmp (struct __v1__jmp_buf_tag __env[1], int __val)
74 __attribute__ ((__noreturn__));
76 /* Use the same type for `jmp_buf' and `sigjmp_buf'.
77 The `__mask_was_saved' flag determines whether
78 or not `longjmp' will restore the signal mask. */
79 typedef struct __v1__jmp_buf_tag __v1__sigjmp_buf[1];
81 /* Jump to the environment saved in ENV, making the
82 sigsetjmp call there return VAL, or 1 if VAL is 0.
83 Restore the signal mask if that sigsetjmp call saved it.
84 This is just an alias `longjmp'. */
85 extern void __v1siglongjmp (__v1__sigjmp_buf __env, int __val)
86 __attribute__ ((__noreturn__));
88 /* Internal machine-dependent function to restore context sans signal mask. */
89 extern void __v1__longjmp (__jmp_buf __env, int __val)
90 __attribute__ ((__noreturn__));
92 /* Internal function to possibly save the current mask of blocked signals
93 in ENV, and always set the flag saying whether or not it was saved.
94 This is used by the machine-dependent definition of `__sigsetjmp'.
95 Always returns zero, for convenience. */
96 extern int __v1__sigjmp_save (__v1__jmp_buf __env, int __savemask);
98 extern void _longjmp_unwind (__v1__jmp_buf env, int val);
100 extern void __v1__libc_siglongjmp (__v1__sigjmp_buf env, int val)
101 __attribute__ ((noreturn));
103 extern void __v1__libc_longjmp (__v1__sigjmp_buf env, int val)
104 __attribute__ ((noreturn));
106 libc_hidden_proto (__v1__libc_longjmp)
107 libc_hidden_proto (__v1_setjmp)
108 libc_hidden_proto (__v1__sigsetjmp)
109 #endif /* !_ASM */
111 #endif /* ifndef _V1_SETJMP_H */