diff options
Diffstat (limited to 'src/internal/syscall.c')
-rw-r--r-- | src/internal/syscall.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/internal/syscall.c b/src/internal/syscall.c new file mode 100644 index 0000000..4f159e0 --- /dev/null +++ b/src/internal/syscall.c @@ -0,0 +1,11 @@ +#include <errno.h> +#include <unistd.h> + +long __syscall_ret(unsigned long r) +{ + if (r >= (unsigned long)-1 - 4096) { + errno = -(long)r; + return -1; + } + return (long)r; +} |