summaryrefslogtreecommitdiff
path: root/src/libc/include/setjmp.h
diff options
context:
space:
mode:
authordzwdz2023-08-14 18:51:07 +0200
committerdzwdz2023-08-14 18:51:07 +0200
commit642b5fb0007b64c77d186fcb018d571152ee1d47 (patch)
tree1c466461f3602d306be309a053edae558ef2568e /src/libc/include/setjmp.h
parent8050069c57b729c18c19b1a03ab6e4bf63b4735e (diff)
reorganization: first steps
Diffstat (limited to 'src/libc/include/setjmp.h')
-rw-r--r--src/libc/include/setjmp.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libc/include/setjmp.h b/src/libc/include/setjmp.h
new file mode 100644
index 0000000..6d05d79
--- /dev/null
+++ b/src/libc/include/setjmp.h
@@ -0,0 +1,18 @@
+#pragma once
+#include <bits/panic.h>
+
+typedef uint64_t jmp_buf[8]; /* rbx, rsp, rbp, r12, r13, r14, r15, rip */
+typedef char sigjmp_buf[1];
+
+int setjmp(jmp_buf env);
+_Noreturn void longjmp(jmp_buf env, int val);
+
+static inline int sigsetjmp(sigjmp_buf env, int savemask) {
+ (void)env; (void)savemask;
+ return 0;
+}
+
+static inline _Noreturn void siglongjmp(sigjmp_buf env, int val) {
+ (void)env; (void)val;
+ __libc_panic("unimplemented");
+}