aboutsummaryrefslogtreecommitdiff
path: root/libs/libc/inc/errno.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libc/inc/errno.h')
-rw-r--r--libs/libc/inc/errno.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/libc/inc/errno.h b/libs/libc/inc/errno.h
index e226aba..133f543 100644
--- a/libs/libc/inc/errno.h
+++ b/libs/libc/inc/errno.h
@@ -47,6 +47,12 @@ typedef s32 res;
#ifdef userspace
#define errno (*__errno())
extern u32 *__errno(void);
+
+#define return_errno(__num) \
+ { \
+ errno = __num; \
+ return -errno; \
+ }
#endif
#endif