setjmp.h revision 679518f4
1/*
2 * Copyright 2004-2018 Haiku, Inc.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef _SETJMP_H_
6#define _SETJMP_H_
7
8
9#include <config/HaikuConfig.h>
10
11#include <signal.h>
12
13/* include architecture specific definitions */
14#include __HAIKU_ARCH_HEADER(arch_setjmp.h)
15
16typedef struct __jmp_buf_tag {
17	__jmp_buf	regs;		/* saved registers, stack & program pointer */
18	sigset_t	inverted_signal_mask;
19} jmp_buf[1];
20
21typedef jmp_buf sigjmp_buf;
22
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28extern int	_setjmp(jmp_buf jumpBuffer);
29extern int	setjmp(jmp_buf jumpBuffer);
30extern int	sigsetjmp(jmp_buf jumpBuffer, int saveMask);
31
32extern void	_longjmp(jmp_buf jumpBuffer, int value)
33	__attribute__ ((noreturn));
34extern void	longjmp(jmp_buf jumpBuffer, int value)
35	__attribute__ ((noreturn));
36extern void	siglongjmp(sigjmp_buf jumpBuffer, int value)
37	__attribute__ ((noreturn));
38
39#ifdef __cplusplus
40}
41#endif
42
43#endif /* _SETJMP_H_ */
44