net: Use chan flag O_NONBLOCK for nonblocking
[akaros.git] / kern / include / setjmp.h
index c6c612e..f45808a 100644 (file)
@@ -1,11 +1,18 @@
 // Kernel implementations for setjmp/longjmp.
 
-#ifndef ROS_SETJMP_H
-#define ROS_SETJMP_H
+#pragma once
 
 #include <arch/setjmp.h>
 
-int setjmp(struct jmpbuf *env) __attribute__((returns_twice));
-void longjmp(struct jmpbuf *env, void * val) __attribute__((noreturn));
+int slim_setjmp(struct jmpbuf *env) __attribute__((returns_twice));
+void longjmp(struct jmpbuf *env, int val) __attribute__((noreturn));
 
-#endif /* !ROS_SETJMP_H */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+
+#define setjmp(jb) ({bool err;                                                 \
+                    __ros_clobber_callee_regs();                               \
+                    err = slim_setjmp(jb);                                     \
+                    err;})
+
+#pragma GCC diagnostic pop