4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-15 02:09:19 +08:00
Jeff Johnston c5ef1e95be 2002-04-08 Jeff Johnston <jjohnstn@redhat.com>
* libc/sys/linux/include/setjmp.h: Add sigjmp_buf type,
        siglongjmp prototype, and sigsetjmp macro definition.
        * libc/sys/linux/siglongjmp.c: New file.
        * libc/sys/linux/Makefile.am: Add support for siglongjmp.
        * libc/sys/linux/Makefile.in: Regenerated.
2002-04-08 20:33:46 +00:00

40 lines
872 B
C

/*
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;
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_ */