diff options
Diffstat (limited to 'lib/libc/internal/syscall.c')
| -rw-r--r-- | lib/libc/internal/syscall.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/libc/internal/syscall.c b/lib/libc/internal/syscall.c new file mode 100644 index 00000000..f7fd3c4b --- /dev/null +++ b/lib/libc/internal/syscall.c @@ -0,0 +1,12 @@ +#include <errno.h> +#include <sys/cdefs.h> + +long __syscall_ret(long ret) +{ + if (__predict_false(ret > -4096 && ret < 0)) { + errno = (int)-ret; + ret = -1; + } + + return ret; +} |
