Debian Codegraph @

share/libc/setjmp.h

raw
1 /**************************************************************************/
2 /* */
3 /* This file is part of Frama-C. */
4 /* */
5 /* Copyright (C) 2007-2022 */
6 /* CEA (Commissariat à l'énergie atomique et aux énergies */
7 /* alternatives) */
8 /* */
9 /* you can redistribute it and/or modify it under the terms of the GNU */
10 /* Lesser General Public License as published by the Free Software */
11 /* Foundation, version 2.1. */
12 /* */
13 /* It is distributed in the hope that it will be useful, */
14 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
15 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
16 /* GNU Lesser General Public License for more details. */
17 /* */
18 /* See the GNU Lesser General Public License version 2.1 */
19 /* for more details (enclosed in the file licenses/LGPLv2.1). */
20 /* */
21 /**************************************************************************/
22
23 #ifndef __FC_SETJMP
24 #define __FC_SETJMP
25 #include "features.h"
26 __PUSH_FC_STDLIB
27 __BEGIN_DECLS
28
29 /* Note: setjmp/longjmp/sigsetjmp/siglongjmp are currently unsupported
30 by Frama-C and should not be used. */
31
32 typedef int jmp_buf[5]; // arbitrary size
33
34 /*@ assigns env[0..4]; // unsound - should "assigns \anything" */
35 extern int setjmp(jmp_buf env);
36
37 /*@
38 assigns \nothing;
39 ensures never_terminates: \false;
40 */
41 extern void longjmp(jmp_buf env, int val);
42
43 #include "__fc_define_sigset_t.h"
44 typedef struct __fc_sigjmp_buf {jmp_buf buf; sigset_t sigs;} sigjmp_buf;
45
46
47 extern int sigsetjmp(sigjmp_buf env, int savesigs);
48
49 /*@
50 assigns \nothing;
51 ensures never_terminates: \false;
52 */
53 extern void siglongjmp(sigjmp_buf env, int val);
54
55
56 __END_DECLS
57
58 __POP_FC_STDLIB
59 #endif