aboutsummaryrefslogtreecommitdiff
path: root/libs/libc/inc/errno.h
diff options
context:
space:
mode:
authorMarvin Borner2021-03-28 14:01:53 +0200
committerMarvin Borner2021-03-28 14:01:53 +0200
commit60750501da4eb0c020e971b45ae3a964c903e12d (patch)
treefc95ff546a7acaa22327bd27dc098230f820c531 /libs/libc/inc/errno.h
parentba2c07447ba1278d8ad38ca58a8ae94c82d2d008 (diff)
Fun with widgets
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