regression: mmap for fd
[lunaix-os.git] / lunaix-os / includes / lunaix / syscall_utils.h
diff --git a/lunaix-os/includes/lunaix/syscall_utils.h b/lunaix-os/includes/lunaix/syscall_utils.h
new file mode 100644 (file)
index 0000000..fcc7dc3
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef __LUNAIX_SYSCALL_UTILS_H
+#define __LUNAIX_SYSCALL_UTILS_H
+
+#include <lunaix/process.h>
+#include <lunaix/syscall.h>
+
+#define DO_STATUS(errno) SYSCALL_ESTATUS(__current->k_status = errno)
+#define DO_STATUS_OR_RETURN(errno) ({ errno < 0 ? DO_STATUS(errno) : errno; })
+
+#endif /* __LUNAIX_SYSCALL_UTILS_H */