Luna/libc/include/setjmp.h
apio d00ca0d3ed
All checks were successful
continuous-integration/drone/push Build is passing
libc: Add setjmp.h
Partially taken from pre-rewrite Luna, converted setjmp.asm to GNU assembly.
2023-03-28 19:40:48 +02:00

31 lines
723 B
C

/* setjmp.h: nonlocal gotos. */
#ifndef _SETJMP_H
#define _SETJMP_H
#include <bits/attrs.h>
#include <bits/setjmp-types.h>
#ifdef __cplusplus
extern "C"
{
#endif
/* Saves the current execution state in env. */
int setjmp(jmp_buf env);
/* Right now, does the exact same thing as setjmp() (savesigs is ignored), since signals are not implemented. */
int sigsetjmp(sigjmp_buf env, int savesigs);
/* Restores the execution state saved in env by a setjmp() call. */
__noreturn void longjmp(jmp_buf env, int val);
/* Right now, does the exact same as longjmp(), since signals are not implemented. */
__noreturn void siglongjmp(sigjmp_buf env, int val);
#ifdef __cplusplus
}
#endif
#endif