Welcome to mirror list, hosted at ThFree Co, Russian Federation.

setjmp.h « include « linux « sys « libc « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f07dbab6d1c4d8136548fa5ff55517740a3eca2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
	setjmp.h
	stubs for future use.
*/

#ifndef _SETJMP_H_
#ifdef __cplusplus
extern "C" {
#endif
#define _SETJMP_H_

#include "_ansi.h"
#include <machine/setjmp.h>
#include <signal.h> /* for sigset_t and sigprocmask */

typedef struct __sigjmpbuf
{
  __jmp_buf __buf;
  int __is_mask_saved;
  sigset_t __saved_mask;
} sigjmp_buf;

typedef __jmp_buf jmp_buf;

void	_EXFUN(longjmp,(jmp_buf __jmpb, int __retval));
int	_EXFUN(setjmp,(jmp_buf __jmpb));
void	_EXFUN(siglongjmp,(sigjmp_buf __jmpb, int __retval));
int	_EXFUN(sigsetjmp,(sigjmp_buf __jmpb, int __savemask));

/* sigsetjmp is implemented as macro using setjmp */

#define sigsetjmp(__jmpb, __savemask) \
                 ( __jmpb.__is_mask_saved = __savemask && \
                   (sigprocmask (SIG_BLOCK, NULL, &__jmpb.__saved_mask) == 0), \
                    setjmp (__jmpb.__buf) )

#ifdef __cplusplus
}
#endif
#endif /* _SETJMP_H_ */