aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-03-13 00:44:33 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-03-13 00:44:33 +0000
commitec706c24acb4d1db6a583a57b76adfb9250d39eb (patch)
treefcb512131936b2b686571bc53f2b6a3b06fca45f
parent980508b0ead3ee01e99e93635c57eb76d1aba62d (diff)
parent9aceab50155b17741faded1fb22e2daa51a07fb1 (diff)
downloadandroid_bionic-ec706c24acb4d1db6a583a57b76adfb9250d39eb.tar.gz
android_bionic-ec706c24acb4d1db6a583a57b76adfb9250d39eb.tar.bz2
android_bionic-ec706c24acb4d1db6a583a57b76adfb9250d39eb.zip
Merge "Use the kernel's MAX_ERRNO in the syscall stubs."
-rw-r--r--libc/arch-arm/bionic/clone.S17
-rw-r--r--libc/arch-arm/bionic/kill.S9
-rw-r--r--libc/arch-arm/bionic/syscall.S8
-rw-r--r--libc/arch-arm/bionic/tgkill.S8
-rw-r--r--libc/arch-arm/bionic/tkill.S8
-rw-r--r--libc/arch-arm/syscalls/__brk.S8
-rw-r--r--libc/arch-arm/syscalls/__fcntl.S8
-rw-r--r--libc/arch-arm/syscalls/__fcntl64.S8
-rw-r--r--libc/arch-arm/syscalls/__fork.S8
-rw-r--r--libc/arch-arm/syscalls/__fstatfs64.S8
-rw-r--r--libc/arch-arm/syscalls/__getcpu.S8
-rw-r--r--libc/arch-arm/syscalls/__getcwd.S8
-rw-r--r--libc/arch-arm/syscalls/__getpriority.S8
-rw-r--r--libc/arch-arm/syscalls/__ioctl.S8
-rw-r--r--libc/arch-arm/syscalls/__llseek.S8
-rw-r--r--libc/arch-arm/syscalls/__mmap2.S8
-rw-r--r--libc/arch-arm/syscalls/__open.S8
-rw-r--r--libc/arch-arm/syscalls/__openat.S8
-rw-r--r--libc/arch-arm/syscalls/__ptrace.S8
-rw-r--r--libc/arch-arm/syscalls/__reboot.S8
-rw-r--r--libc/arch-arm/syscalls/__rt_sigaction.S8
-rw-r--r--libc/arch-arm/syscalls/__rt_sigprocmask.S8
-rw-r--r--libc/arch-arm/syscalls/__rt_sigtimedwait.S8
-rw-r--r--libc/arch-arm/syscalls/__sched_getaffinity.S8
-rw-r--r--libc/arch-arm/syscalls/__set_tls.S8
-rw-r--r--libc/arch-arm/syscalls/__setresuid.S8
-rw-r--r--libc/arch-arm/syscalls/__setreuid.S8
-rw-r--r--libc/arch-arm/syscalls/__setuid.S8
-rw-r--r--libc/arch-arm/syscalls/__sigsuspend.S8
-rw-r--r--libc/arch-arm/syscalls/__statfs64.S8
-rw-r--r--libc/arch-arm/syscalls/__sys_clone.S8
-rw-r--r--libc/arch-arm/syscalls/__syslog.S8
-rw-r--r--libc/arch-arm/syscalls/__timer_create.S8
-rw-r--r--libc/arch-arm/syscalls/__timer_delete.S8
-rw-r--r--libc/arch-arm/syscalls/__timer_getoverrun.S8
-rw-r--r--libc/arch-arm/syscalls/__timer_gettime.S8
-rw-r--r--libc/arch-arm/syscalls/__timer_settime.S8
-rw-r--r--libc/arch-arm/syscalls/__wait4.S8
-rw-r--r--libc/arch-arm/syscalls/__waitid.S8
-rw-r--r--libc/arch-arm/syscalls/_exit.S8
-rw-r--r--libc/arch-arm/syscalls/_exit_thread.S8
-rw-r--r--libc/arch-arm/syscalls/accept.S8
-rw-r--r--libc/arch-arm/syscalls/access.S8
-rw-r--r--libc/arch-arm/syscalls/acct.S8
-rw-r--r--libc/arch-arm/syscalls/bind.S8
-rw-r--r--libc/arch-arm/syscalls/cacheflush.S8
-rw-r--r--libc/arch-arm/syscalls/capget.S8
-rw-r--r--libc/arch-arm/syscalls/capset.S8
-rw-r--r--libc/arch-arm/syscalls/chdir.S8
-rw-r--r--libc/arch-arm/syscalls/chmod.S8
-rw-r--r--libc/arch-arm/syscalls/chown.S8
-rw-r--r--libc/arch-arm/syscalls/chroot.S8
-rw-r--r--libc/arch-arm/syscalls/clock_getres.S8
-rw-r--r--libc/arch-arm/syscalls/clock_gettime.S8
-rw-r--r--libc/arch-arm/syscalls/clock_nanosleep.S8
-rw-r--r--libc/arch-arm/syscalls/clock_settime.S8
-rw-r--r--libc/arch-arm/syscalls/close.S8
-rw-r--r--libc/arch-arm/syscalls/connect.S8
-rw-r--r--libc/arch-arm/syscalls/delete_module.S8
-rw-r--r--libc/arch-arm/syscalls/dup.S8
-rw-r--r--libc/arch-arm/syscalls/dup2.S8
-rw-r--r--libc/arch-arm/syscalls/epoll_create.S8
-rw-r--r--libc/arch-arm/syscalls/epoll_ctl.S8
-rw-r--r--libc/arch-arm/syscalls/epoll_wait.S8
-rw-r--r--libc/arch-arm/syscalls/eventfd.S8
-rw-r--r--libc/arch-arm/syscalls/execve.S8
-rw-r--r--libc/arch-arm/syscalls/faccessat.S8
-rw-r--r--libc/arch-arm/syscalls/fchdir.S8
-rw-r--r--libc/arch-arm/syscalls/fchmod.S8
-rw-r--r--libc/arch-arm/syscalls/fchmodat.S8
-rw-r--r--libc/arch-arm/syscalls/fchown.S8
-rw-r--r--libc/arch-arm/syscalls/fchownat.S8
-rw-r--r--libc/arch-arm/syscalls/fdatasync.S8
-rw-r--r--libc/arch-arm/syscalls/fgetxattr.S8
-rw-r--r--libc/arch-arm/syscalls/flistxattr.S8
-rw-r--r--libc/arch-arm/syscalls/flock.S8
-rw-r--r--libc/arch-arm/syscalls/fremovexattr.S8
-rw-r--r--libc/arch-arm/syscalls/fsetxattr.S8
-rw-r--r--libc/arch-arm/syscalls/fstat.S8
-rw-r--r--libc/arch-arm/syscalls/fstatat.S8
-rw-r--r--libc/arch-arm/syscalls/fsync.S8
-rw-r--r--libc/arch-arm/syscalls/ftruncate.S8
-rw-r--r--libc/arch-arm/syscalls/ftruncate64.S8
-rw-r--r--libc/arch-arm/syscalls/futex.S8
-rw-r--r--libc/arch-arm/syscalls/getdents.S8
-rw-r--r--libc/arch-arm/syscalls/getegid.S8
-rw-r--r--libc/arch-arm/syscalls/geteuid.S8
-rw-r--r--libc/arch-arm/syscalls/getgid.S8
-rw-r--r--libc/arch-arm/syscalls/getgroups.S8
-rw-r--r--libc/arch-arm/syscalls/getitimer.S8
-rw-r--r--libc/arch-arm/syscalls/getpeername.S8
-rw-r--r--libc/arch-arm/syscalls/getpgid.S8
-rw-r--r--libc/arch-arm/syscalls/getpid.S8
-rw-r--r--libc/arch-arm/syscalls/getppid.S8
-rw-r--r--libc/arch-arm/syscalls/getresgid.S8
-rw-r--r--libc/arch-arm/syscalls/getresuid.S8
-rw-r--r--libc/arch-arm/syscalls/getrlimit.S8
-rw-r--r--libc/arch-arm/syscalls/getrusage.S8
-rw-r--r--libc/arch-arm/syscalls/getsid.S8
-rw-r--r--libc/arch-arm/syscalls/getsockname.S8
-rw-r--r--libc/arch-arm/syscalls/getsockopt.S8
-rw-r--r--libc/arch-arm/syscalls/gettid.S8
-rw-r--r--libc/arch-arm/syscalls/gettimeofday.S8
-rw-r--r--libc/arch-arm/syscalls/getuid.S8
-rw-r--r--libc/arch-arm/syscalls/getxattr.S8
-rw-r--r--libc/arch-arm/syscalls/init_module.S8
-rw-r--r--libc/arch-arm/syscalls/inotify_add_watch.S8
-rw-r--r--libc/arch-arm/syscalls/inotify_init.S8
-rw-r--r--libc/arch-arm/syscalls/inotify_rm_watch.S8
-rw-r--r--libc/arch-arm/syscalls/ioprio_get.S8
-rw-r--r--libc/arch-arm/syscalls/ioprio_set.S8
-rw-r--r--libc/arch-arm/syscalls/klogctl.S8
-rw-r--r--libc/arch-arm/syscalls/lchown.S8
-rw-r--r--libc/arch-arm/syscalls/lgetxattr.S8
-rw-r--r--libc/arch-arm/syscalls/link.S8
-rw-r--r--libc/arch-arm/syscalls/listen.S8
-rw-r--r--libc/arch-arm/syscalls/listxattr.S8
-rw-r--r--libc/arch-arm/syscalls/llistxattr.S8
-rw-r--r--libc/arch-arm/syscalls/lremovexattr.S8
-rw-r--r--libc/arch-arm/syscalls/lseek.S8
-rw-r--r--libc/arch-arm/syscalls/lsetxattr.S8
-rw-r--r--libc/arch-arm/syscalls/lstat.S8
-rw-r--r--libc/arch-arm/syscalls/madvise.S8
-rw-r--r--libc/arch-arm/syscalls/mincore.S8
-rw-r--r--libc/arch-arm/syscalls/mkdir.S8
-rw-r--r--libc/arch-arm/syscalls/mkdirat.S8
-rw-r--r--libc/arch-arm/syscalls/mknod.S8
-rw-r--r--libc/arch-arm/syscalls/mlock.S8
-rw-r--r--libc/arch-arm/syscalls/mlockall.S8
-rw-r--r--libc/arch-arm/syscalls/mount.S8
-rw-r--r--libc/arch-arm/syscalls/mprotect.S8
-rw-r--r--libc/arch-arm/syscalls/mremap.S8
-rw-r--r--libc/arch-arm/syscalls/msync.S8
-rw-r--r--libc/arch-arm/syscalls/munlock.S8
-rw-r--r--libc/arch-arm/syscalls/munlockall.S8
-rw-r--r--libc/arch-arm/syscalls/munmap.S8
-rw-r--r--libc/arch-arm/syscalls/nanosleep.S8
-rw-r--r--libc/arch-arm/syscalls/pause.S8
-rw-r--r--libc/arch-arm/syscalls/perf_event_open.S8
-rw-r--r--libc/arch-arm/syscalls/personality.S8
-rw-r--r--libc/arch-arm/syscalls/pipe.S8
-rw-r--r--libc/arch-arm/syscalls/pipe2.S8
-rw-r--r--libc/arch-arm/syscalls/poll.S8
-rw-r--r--libc/arch-arm/syscalls/prctl.S8
-rw-r--r--libc/arch-arm/syscalls/pread64.S8
-rw-r--r--libc/arch-arm/syscalls/pwrite64.S8
-rw-r--r--libc/arch-arm/syscalls/read.S8
-rw-r--r--libc/arch-arm/syscalls/readahead.S8
-rw-r--r--libc/arch-arm/syscalls/readlink.S8
-rw-r--r--libc/arch-arm/syscalls/readv.S8
-rw-r--r--libc/arch-arm/syscalls/recvfrom.S8
-rw-r--r--libc/arch-arm/syscalls/recvmsg.S8
-rw-r--r--libc/arch-arm/syscalls/removexattr.S8
-rw-r--r--libc/arch-arm/syscalls/rename.S8
-rw-r--r--libc/arch-arm/syscalls/renameat.S8
-rw-r--r--libc/arch-arm/syscalls/rmdir.S8
-rw-r--r--libc/arch-arm/syscalls/sched_get_priority_max.S8
-rw-r--r--libc/arch-arm/syscalls/sched_get_priority_min.S8
-rw-r--r--libc/arch-arm/syscalls/sched_getparam.S8
-rw-r--r--libc/arch-arm/syscalls/sched_getscheduler.S8
-rw-r--r--libc/arch-arm/syscalls/sched_rr_get_interval.S8
-rw-r--r--libc/arch-arm/syscalls/sched_setaffinity.S8
-rw-r--r--libc/arch-arm/syscalls/sched_setparam.S8
-rw-r--r--libc/arch-arm/syscalls/sched_setscheduler.S8
-rw-r--r--libc/arch-arm/syscalls/sched_yield.S8
-rw-r--r--libc/arch-arm/syscalls/select.S8
-rw-r--r--libc/arch-arm/syscalls/sendfile.S8
-rw-r--r--libc/arch-arm/syscalls/sendmsg.S8
-rw-r--r--libc/arch-arm/syscalls/sendto.S8
-rw-r--r--libc/arch-arm/syscalls/setgid.S8
-rw-r--r--libc/arch-arm/syscalls/setgroups.S8
-rw-r--r--libc/arch-arm/syscalls/setitimer.S8
-rw-r--r--libc/arch-arm/syscalls/setpgid.S8
-rw-r--r--libc/arch-arm/syscalls/setpriority.S8
-rw-r--r--libc/arch-arm/syscalls/setregid.S8
-rw-r--r--libc/arch-arm/syscalls/setresgid.S8
-rw-r--r--libc/arch-arm/syscalls/setrlimit.S8
-rw-r--r--libc/arch-arm/syscalls/setsid.S8
-rw-r--r--libc/arch-arm/syscalls/setsockopt.S8
-rw-r--r--libc/arch-arm/syscalls/settimeofday.S8
-rw-r--r--libc/arch-arm/syscalls/setxattr.S8
-rw-r--r--libc/arch-arm/syscalls/shutdown.S8
-rw-r--r--libc/arch-arm/syscalls/sigaction.S8
-rw-r--r--libc/arch-arm/syscalls/sigaltstack.S8
-rw-r--r--libc/arch-arm/syscalls/signalfd4.S8
-rw-r--r--libc/arch-arm/syscalls/sigpending.S8
-rw-r--r--libc/arch-arm/syscalls/sigprocmask.S8
-rw-r--r--libc/arch-arm/syscalls/socket.S8
-rw-r--r--libc/arch-arm/syscalls/socketpair.S8
-rw-r--r--libc/arch-arm/syscalls/stat.S8
-rw-r--r--libc/arch-arm/syscalls/symlink.S8
-rw-r--r--libc/arch-arm/syscalls/sync.S8
-rw-r--r--libc/arch-arm/syscalls/sysinfo.S8
-rw-r--r--libc/arch-arm/syscalls/times.S8
-rw-r--r--libc/arch-arm/syscalls/truncate.S8
-rw-r--r--libc/arch-arm/syscalls/umask.S8
-rw-r--r--libc/arch-arm/syscalls/umount2.S8
-rw-r--r--libc/arch-arm/syscalls/uname.S8
-rw-r--r--libc/arch-arm/syscalls/unlink.S8
-rw-r--r--libc/arch-arm/syscalls/unlinkat.S8
-rw-r--r--libc/arch-arm/syscalls/unshare.S8
-rw-r--r--libc/arch-arm/syscalls/utimensat.S8
-rw-r--r--libc/arch-arm/syscalls/utimes.S8
-rw-r--r--libc/arch-arm/syscalls/vfork.S8
-rw-r--r--libc/arch-arm/syscalls/write.S8
-rw-r--r--libc/arch-arm/syscalls/writev.S8
-rw-r--r--libc/arch-x86/syscalls/__brk.S3
-rw-r--r--libc/arch-x86/syscalls/__fcntl.S3
-rw-r--r--libc/arch-x86/syscalls/__fcntl64.S3
-rw-r--r--libc/arch-x86/syscalls/__fork.S3
-rw-r--r--libc/arch-x86/syscalls/__fstatfs64.S3
-rw-r--r--libc/arch-x86/syscalls/__getcpu.S3
-rw-r--r--libc/arch-x86/syscalls/__getcwd.S3
-rw-r--r--libc/arch-x86/syscalls/__getpriority.S3
-rw-r--r--libc/arch-x86/syscalls/__ioctl.S3
-rw-r--r--libc/arch-x86/syscalls/__llseek.S3
-rw-r--r--libc/arch-x86/syscalls/__mmap2.S3
-rw-r--r--libc/arch-x86/syscalls/__open.S3
-rw-r--r--libc/arch-x86/syscalls/__openat.S3
-rw-r--r--libc/arch-x86/syscalls/__ptrace.S3
-rw-r--r--libc/arch-x86/syscalls/__reboot.S3
-rw-r--r--libc/arch-x86/syscalls/__rt_sigaction.S3
-rw-r--r--libc/arch-x86/syscalls/__rt_sigprocmask.S3
-rw-r--r--libc/arch-x86/syscalls/__rt_sigtimedwait.S3
-rw-r--r--libc/arch-x86/syscalls/__sched_getaffinity.S3
-rw-r--r--libc/arch-x86/syscalls/__set_thread_area.S3
-rw-r--r--libc/arch-x86/syscalls/__setresuid.S3
-rw-r--r--libc/arch-x86/syscalls/__setreuid.S3
-rw-r--r--libc/arch-x86/syscalls/__setuid.S3
-rw-r--r--libc/arch-x86/syscalls/__sigsuspend.S3
-rw-r--r--libc/arch-x86/syscalls/__statfs64.S3
-rw-r--r--libc/arch-x86/syscalls/__sys_clone.S3
-rw-r--r--libc/arch-x86/syscalls/__syslog.S3
-rw-r--r--libc/arch-x86/syscalls/__timer_create.S3
-rw-r--r--libc/arch-x86/syscalls/__timer_delete.S3
-rw-r--r--libc/arch-x86/syscalls/__timer_getoverrun.S3
-rw-r--r--libc/arch-x86/syscalls/__timer_gettime.S3
-rw-r--r--libc/arch-x86/syscalls/__timer_settime.S3
-rw-r--r--libc/arch-x86/syscalls/__wait4.S3
-rw-r--r--libc/arch-x86/syscalls/__waitid.S3
-rw-r--r--libc/arch-x86/syscalls/_exit.S3
-rw-r--r--libc/arch-x86/syscalls/_exit_thread.S3
-rw-r--r--libc/arch-x86/syscalls/_waitpid.S3
-rw-r--r--libc/arch-x86/syscalls/accept.S3
-rw-r--r--libc/arch-x86/syscalls/access.S3
-rw-r--r--libc/arch-x86/syscalls/acct.S3
-rw-r--r--libc/arch-x86/syscalls/bind.S3
-rw-r--r--libc/arch-x86/syscalls/capget.S3
-rw-r--r--libc/arch-x86/syscalls/capset.S3
-rw-r--r--libc/arch-x86/syscalls/chdir.S3
-rw-r--r--libc/arch-x86/syscalls/chmod.S3
-rw-r--r--libc/arch-x86/syscalls/chown.S3
-rw-r--r--libc/arch-x86/syscalls/chroot.S3
-rw-r--r--libc/arch-x86/syscalls/clock_getres.S3
-rw-r--r--libc/arch-x86/syscalls/clock_gettime.S3
-rw-r--r--libc/arch-x86/syscalls/clock_nanosleep.S3
-rw-r--r--libc/arch-x86/syscalls/clock_settime.S3
-rw-r--r--libc/arch-x86/syscalls/close.S3
-rw-r--r--libc/arch-x86/syscalls/connect.S3
-rw-r--r--libc/arch-x86/syscalls/delete_module.S3
-rw-r--r--libc/arch-x86/syscalls/dup.S3
-rw-r--r--libc/arch-x86/syscalls/dup2.S3
-rw-r--r--libc/arch-x86/syscalls/epoll_create.S3
-rw-r--r--libc/arch-x86/syscalls/epoll_ctl.S3
-rw-r--r--libc/arch-x86/syscalls/epoll_wait.S3
-rw-r--r--libc/arch-x86/syscalls/eventfd.S3
-rw-r--r--libc/arch-x86/syscalls/execve.S3
-rw-r--r--libc/arch-x86/syscalls/faccessat.S3
-rw-r--r--libc/arch-x86/syscalls/fchdir.S3
-rw-r--r--libc/arch-x86/syscalls/fchmod.S3
-rw-r--r--libc/arch-x86/syscalls/fchmodat.S3
-rw-r--r--libc/arch-x86/syscalls/fchown.S3
-rw-r--r--libc/arch-x86/syscalls/fchownat.S3
-rw-r--r--libc/arch-x86/syscalls/fdatasync.S3
-rw-r--r--libc/arch-x86/syscalls/fgetxattr.S3
-rw-r--r--libc/arch-x86/syscalls/flistxattr.S3
-rw-r--r--libc/arch-x86/syscalls/flock.S3
-rw-r--r--libc/arch-x86/syscalls/fremovexattr.S3
-rw-r--r--libc/arch-x86/syscalls/fsetxattr.S3
-rw-r--r--libc/arch-x86/syscalls/fstat.S3
-rw-r--r--libc/arch-x86/syscalls/fstatat.S3
-rw-r--r--libc/arch-x86/syscalls/fsync.S3
-rw-r--r--libc/arch-x86/syscalls/ftruncate.S3
-rw-r--r--libc/arch-x86/syscalls/ftruncate64.S3
-rw-r--r--libc/arch-x86/syscalls/futex.S3
-rw-r--r--libc/arch-x86/syscalls/getdents.S3
-rw-r--r--libc/arch-x86/syscalls/getegid.S3
-rw-r--r--libc/arch-x86/syscalls/geteuid.S3
-rw-r--r--libc/arch-x86/syscalls/getgid.S3
-rw-r--r--libc/arch-x86/syscalls/getgroups.S3
-rw-r--r--libc/arch-x86/syscalls/getitimer.S3
-rw-r--r--libc/arch-x86/syscalls/getpeername.S3
-rw-r--r--libc/arch-x86/syscalls/getpgid.S3
-rw-r--r--libc/arch-x86/syscalls/getpid.S3
-rw-r--r--libc/arch-x86/syscalls/getppid.S3
-rw-r--r--libc/arch-x86/syscalls/getresgid.S3
-rw-r--r--libc/arch-x86/syscalls/getresuid.S3
-rw-r--r--libc/arch-x86/syscalls/getrlimit.S3
-rw-r--r--libc/arch-x86/syscalls/getrusage.S3
-rw-r--r--libc/arch-x86/syscalls/getsid.S3
-rw-r--r--libc/arch-x86/syscalls/getsockname.S3
-rw-r--r--libc/arch-x86/syscalls/getsockopt.S3
-rw-r--r--libc/arch-x86/syscalls/gettid.S3
-rw-r--r--libc/arch-x86/syscalls/gettimeofday.S3
-rw-r--r--libc/arch-x86/syscalls/getuid.S3
-rw-r--r--libc/arch-x86/syscalls/getxattr.S3
-rw-r--r--libc/arch-x86/syscalls/init_module.S3
-rw-r--r--libc/arch-x86/syscalls/inotify_add_watch.S3
-rw-r--r--libc/arch-x86/syscalls/inotify_init.S3
-rw-r--r--libc/arch-x86/syscalls/inotify_rm_watch.S3
-rw-r--r--libc/arch-x86/syscalls/ioprio_get.S3
-rw-r--r--libc/arch-x86/syscalls/ioprio_set.S3
-rw-r--r--libc/arch-x86/syscalls/kill.S3
-rw-r--r--libc/arch-x86/syscalls/klogctl.S3
-rw-r--r--libc/arch-x86/syscalls/lchown.S3
-rw-r--r--libc/arch-x86/syscalls/lgetxattr.S3
-rw-r--r--libc/arch-x86/syscalls/link.S3
-rw-r--r--libc/arch-x86/syscalls/listen.S3
-rw-r--r--libc/arch-x86/syscalls/listxattr.S3
-rw-r--r--libc/arch-x86/syscalls/llistxattr.S3
-rw-r--r--libc/arch-x86/syscalls/lremovexattr.S3
-rw-r--r--libc/arch-x86/syscalls/lseek.S3
-rw-r--r--libc/arch-x86/syscalls/lsetxattr.S3
-rw-r--r--libc/arch-x86/syscalls/lstat.S3
-rw-r--r--libc/arch-x86/syscalls/madvise.S3
-rw-r--r--libc/arch-x86/syscalls/mincore.S3
-rw-r--r--libc/arch-x86/syscalls/mkdir.S3
-rw-r--r--libc/arch-x86/syscalls/mkdirat.S3
-rw-r--r--libc/arch-x86/syscalls/mknod.S3
-rw-r--r--libc/arch-x86/syscalls/mlock.S3
-rw-r--r--libc/arch-x86/syscalls/mlockall.S3
-rw-r--r--libc/arch-x86/syscalls/mount.S3
-rw-r--r--libc/arch-x86/syscalls/mprotect.S3
-rw-r--r--libc/arch-x86/syscalls/mremap.S3
-rw-r--r--libc/arch-x86/syscalls/msync.S3
-rw-r--r--libc/arch-x86/syscalls/munlock.S3
-rw-r--r--libc/arch-x86/syscalls/munlockall.S3
-rw-r--r--libc/arch-x86/syscalls/munmap.S3
-rw-r--r--libc/arch-x86/syscalls/nanosleep.S3
-rw-r--r--libc/arch-x86/syscalls/pause.S3
-rw-r--r--libc/arch-x86/syscalls/perf_event_open.S3
-rw-r--r--libc/arch-x86/syscalls/personality.S3
-rw-r--r--libc/arch-x86/syscalls/pipe.S3
-rw-r--r--libc/arch-x86/syscalls/pipe2.S3
-rw-r--r--libc/arch-x86/syscalls/poll.S3
-rw-r--r--libc/arch-x86/syscalls/prctl.S3
-rw-r--r--libc/arch-x86/syscalls/pread64.S3
-rw-r--r--libc/arch-x86/syscalls/pwrite64.S3
-rw-r--r--libc/arch-x86/syscalls/read.S3
-rw-r--r--libc/arch-x86/syscalls/readahead.S3
-rw-r--r--libc/arch-x86/syscalls/readlink.S3
-rw-r--r--libc/arch-x86/syscalls/readv.S3
-rw-r--r--libc/arch-x86/syscalls/recvfrom.S3
-rw-r--r--libc/arch-x86/syscalls/recvmsg.S3
-rw-r--r--libc/arch-x86/syscalls/removexattr.S3
-rw-r--r--libc/arch-x86/syscalls/rename.S3
-rw-r--r--libc/arch-x86/syscalls/renameat.S3
-rw-r--r--libc/arch-x86/syscalls/rmdir.S3
-rw-r--r--libc/arch-x86/syscalls/sched_get_priority_max.S3
-rw-r--r--libc/arch-x86/syscalls/sched_get_priority_min.S3
-rw-r--r--libc/arch-x86/syscalls/sched_getparam.S3
-rw-r--r--libc/arch-x86/syscalls/sched_getscheduler.S3
-rw-r--r--libc/arch-x86/syscalls/sched_rr_get_interval.S3
-rw-r--r--libc/arch-x86/syscalls/sched_setaffinity.S3
-rw-r--r--libc/arch-x86/syscalls/sched_setparam.S3
-rw-r--r--libc/arch-x86/syscalls/sched_setscheduler.S3
-rw-r--r--libc/arch-x86/syscalls/sched_yield.S3
-rw-r--r--libc/arch-x86/syscalls/select.S3
-rw-r--r--libc/arch-x86/syscalls/sendfile.S3
-rw-r--r--libc/arch-x86/syscalls/sendmsg.S3
-rw-r--r--libc/arch-x86/syscalls/sendto.S3
-rw-r--r--libc/arch-x86/syscalls/setgid.S3
-rw-r--r--libc/arch-x86/syscalls/setgroups.S3
-rw-r--r--libc/arch-x86/syscalls/setitimer.S3
-rw-r--r--libc/arch-x86/syscalls/setpgid.S3
-rw-r--r--libc/arch-x86/syscalls/setpriority.S3
-rw-r--r--libc/arch-x86/syscalls/setregid.S3
-rw-r--r--libc/arch-x86/syscalls/setresgid.S3
-rw-r--r--libc/arch-x86/syscalls/setrlimit.S3
-rw-r--r--libc/arch-x86/syscalls/setsid.S3
-rw-r--r--libc/arch-x86/syscalls/setsockopt.S3
-rw-r--r--libc/arch-x86/syscalls/settimeofday.S3
-rw-r--r--libc/arch-x86/syscalls/setxattr.S3
-rw-r--r--libc/arch-x86/syscalls/shutdown.S3
-rw-r--r--libc/arch-x86/syscalls/sigaction.S3
-rw-r--r--libc/arch-x86/syscalls/sigaltstack.S3
-rw-r--r--libc/arch-x86/syscalls/signalfd4.S3
-rw-r--r--libc/arch-x86/syscalls/sigpending.S3
-rw-r--r--libc/arch-x86/syscalls/sigprocmask.S3
-rw-r--r--libc/arch-x86/syscalls/socket.S3
-rw-r--r--libc/arch-x86/syscalls/socketpair.S3
-rw-r--r--libc/arch-x86/syscalls/stat.S3
-rw-r--r--libc/arch-x86/syscalls/symlink.S3
-rw-r--r--libc/arch-x86/syscalls/sync.S3
-rw-r--r--libc/arch-x86/syscalls/sysinfo.S3
-rw-r--r--libc/arch-x86/syscalls/tgkill.S3
-rw-r--r--libc/arch-x86/syscalls/times.S3
-rw-r--r--libc/arch-x86/syscalls/tkill.S3
-rw-r--r--libc/arch-x86/syscalls/truncate.S3
-rw-r--r--libc/arch-x86/syscalls/umask.S3
-rw-r--r--libc/arch-x86/syscalls/umount2.S3
-rw-r--r--libc/arch-x86/syscalls/uname.S3
-rw-r--r--libc/arch-x86/syscalls/unlink.S3
-rw-r--r--libc/arch-x86/syscalls/unlinkat.S3
-rw-r--r--libc/arch-x86/syscalls/unshare.S3
-rw-r--r--libc/arch-x86/syscalls/utimensat.S3
-rw-r--r--libc/arch-x86/syscalls/utimes.S3
-rw-r--r--libc/arch-x86/syscalls/write.S3
-rw-r--r--libc/arch-x86/syscalls/writev.S3
-rw-r--r--libc/bionic/__set_errno.cpp18
-rw-r--r--libc/kernel/common/linux/err.h3
-rwxr-xr-xlibc/tools/gensyscalls.py18
412 files changed, 1459 insertions, 847 deletions
diff --git a/libc/arch-arm/bionic/clone.S b/libc/arch-arm/bionic/clone.S
index 13bc7d765..281230c9e 100644
--- a/libc/arch-arm/bionic/clone.S
+++ b/libc/arch-arm/bionic/clone.S
@@ -26,6 +26,7 @@
* SUCH DAMAGE.
*/
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -45,10 +46,12 @@ ENTRY(__pthread_clone)
movs r0, r0
beq 1f
- # In parent, reload saved registers then either exit or set errno.
+ # In parent, reload saved registers then either return or set errno.
ldmfd sp!, {r4, r7}
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
1: # The child.
# pick the function arg and call address off the stack and jump
@@ -94,10 +97,12 @@ ENTRY(__bionic_clone)
movs r0, r0
beq 1f
- # In the parent, reload saved registers then either exit or set errno.
+ # In the parent, reload saved registers then either return or set errno.
ldmfd sp!, {r4, r5, r6, r7}
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
1: # The child.
ldr r0, [sp, #-4]
diff --git a/libc/arch-arm/bionic/kill.S b/libc/arch-arm/bionic/kill.S
index 33dfc2b5f..7e030f3e3 100644
--- a/libc/arch-arm/bionic/kill.S
+++ b/libc/arch-arm/bionic/kill.S
@@ -32,6 +32,8 @@
abort due to a fatal runtime error (e.g. detection
of a corrupted malloc heap).
*/
+
+#include <linux/err.h>
#include <sys/linux-syscalls.h>
#include <machine/asm.h>
@@ -44,7 +46,8 @@ ENTRY(kill)
ldr r7, =__NR_kill
swi #0
ldmfd sp!, {r4-r7, ip, lr}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(kill)
diff --git a/libc/arch-arm/bionic/syscall.S b/libc/arch-arm/bionic/syscall.S
index 69f3beca5..be9591e4e 100644
--- a/libc/arch-arm/bionic/syscall.S
+++ b/libc/arch-arm/bionic/syscall.S
@@ -26,6 +26,7 @@
* SUCH DAMAGE.
*/
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -39,7 +40,8 @@ ENTRY(syscall)
ldmfd ip, {r3, r4, r5, r6}
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(syscall)
diff --git a/libc/arch-arm/bionic/tgkill.S b/libc/arch-arm/bionic/tgkill.S
index da5c0af7e..60df9e6df 100644
--- a/libc/arch-arm/bionic/tgkill.S
+++ b/libc/arch-arm/bionic/tgkill.S
@@ -33,6 +33,7 @@
of a corrupted malloc heap).
*/
+#include <linux/err.h>
#include <sys/linux-syscalls.h>
#include <machine/asm.h>
@@ -45,7 +46,8 @@ ENTRY(tgkill)
ldr r7, =__NR_tgkill
swi #0
ldmfd sp!, {r4-r7, ip, lr}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(tgkill)
diff --git a/libc/arch-arm/bionic/tkill.S b/libc/arch-arm/bionic/tkill.S
index fdc5ed408..d5bb73935 100644
--- a/libc/arch-arm/bionic/tkill.S
+++ b/libc/arch-arm/bionic/tkill.S
@@ -33,6 +33,7 @@
of a corrupted malloc heap).
*/
+#include <linux/err.h>
#include <sys/linux-syscalls.h>
#include <machine/asm.h>
@@ -45,7 +46,8 @@ ENTRY(tkill)
ldr r7, =__NR_tkill
swi #0
ldmfd sp!, {r4-r7, ip, lr}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(tkill)
diff --git a/libc/arch-arm/syscalls/__brk.S b/libc/arch-arm/syscalls/__brk.S
index e4fcab057..1cc6a172c 100644
--- a/libc/arch-arm/syscalls/__brk.S
+++ b/libc/arch-arm/syscalls/__brk.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__brk)
ldr r7, =__NR_brk
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__brk)
diff --git a/libc/arch-arm/syscalls/__fcntl.S b/libc/arch-arm/syscalls/__fcntl.S
index ee82ef1bd..c15ad66e5 100644
--- a/libc/arch-arm/syscalls/__fcntl.S
+++ b/libc/arch-arm/syscalls/__fcntl.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__fcntl)
ldr r7, =__NR_fcntl
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__fcntl)
diff --git a/libc/arch-arm/syscalls/__fcntl64.S b/libc/arch-arm/syscalls/__fcntl64.S
index 96cc16b4e..ea47a601d 100644
--- a/libc/arch-arm/syscalls/__fcntl64.S
+++ b/libc/arch-arm/syscalls/__fcntl64.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__fcntl64)
ldr r7, =__NR_fcntl64
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__fcntl64)
diff --git a/libc/arch-arm/syscalls/__fork.S b/libc/arch-arm/syscalls/__fork.S
index 9df970286..279155aa7 100644
--- a/libc/arch-arm/syscalls/__fork.S
+++ b/libc/arch-arm/syscalls/__fork.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__fork)
ldr r7, =__NR_fork
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__fork)
diff --git a/libc/arch-arm/syscalls/__fstatfs64.S b/libc/arch-arm/syscalls/__fstatfs64.S
index 6e902148c..e8bc40886 100644
--- a/libc/arch-arm/syscalls/__fstatfs64.S
+++ b/libc/arch-arm/syscalls/__fstatfs64.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__fstatfs64)
ldr r7, =__NR_fstatfs64
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__fstatfs64)
diff --git a/libc/arch-arm/syscalls/__getcpu.S b/libc/arch-arm/syscalls/__getcpu.S
index 7976b0606..83387d525 100644
--- a/libc/arch-arm/syscalls/__getcpu.S
+++ b/libc/arch-arm/syscalls/__getcpu.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__getcpu)
ldr r7, =__NR_getcpu
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__getcpu)
diff --git a/libc/arch-arm/syscalls/__getcwd.S b/libc/arch-arm/syscalls/__getcwd.S
index 6fc2d64e3..781f7d242 100644
--- a/libc/arch-arm/syscalls/__getcwd.S
+++ b/libc/arch-arm/syscalls/__getcwd.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__getcwd)
ldr r7, =__NR_getcwd
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__getcwd)
diff --git a/libc/arch-arm/syscalls/__getpriority.S b/libc/arch-arm/syscalls/__getpriority.S
index 6fb2a4340..8c16fd85a 100644
--- a/libc/arch-arm/syscalls/__getpriority.S
+++ b/libc/arch-arm/syscalls/__getpriority.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__getpriority)
ldr r7, =__NR_getpriority
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__getpriority)
diff --git a/libc/arch-arm/syscalls/__ioctl.S b/libc/arch-arm/syscalls/__ioctl.S
index 56fd607b5..4aef590ba 100644
--- a/libc/arch-arm/syscalls/__ioctl.S
+++ b/libc/arch-arm/syscalls/__ioctl.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__ioctl)
ldr r7, =__NR_ioctl
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__ioctl)
diff --git a/libc/arch-arm/syscalls/__llseek.S b/libc/arch-arm/syscalls/__llseek.S
index 989388668..5891b136e 100644
--- a/libc/arch-arm/syscalls/__llseek.S
+++ b/libc/arch-arm/syscalls/__llseek.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(__llseek)
ldr r7, =__NR__llseek
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__llseek)
diff --git a/libc/arch-arm/syscalls/__mmap2.S b/libc/arch-arm/syscalls/__mmap2.S
index 542b3e025..dfaa0c4b5 100644
--- a/libc/arch-arm/syscalls/__mmap2.S
+++ b/libc/arch-arm/syscalls/__mmap2.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(__mmap2)
ldr r7, =__NR_mmap2
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__mmap2)
diff --git a/libc/arch-arm/syscalls/__open.S b/libc/arch-arm/syscalls/__open.S
index 589d5adc7..9622a9185 100644
--- a/libc/arch-arm/syscalls/__open.S
+++ b/libc/arch-arm/syscalls/__open.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__open)
ldr r7, =__NR_open
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__open)
diff --git a/libc/arch-arm/syscalls/__openat.S b/libc/arch-arm/syscalls/__openat.S
index 10c30d377..2c7b472a9 100644
--- a/libc/arch-arm/syscalls/__openat.S
+++ b/libc/arch-arm/syscalls/__openat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__openat)
ldr r7, =__NR_openat
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__openat)
diff --git a/libc/arch-arm/syscalls/__ptrace.S b/libc/arch-arm/syscalls/__ptrace.S
index 72acd7051..984d499bf 100644
--- a/libc/arch-arm/syscalls/__ptrace.S
+++ b/libc/arch-arm/syscalls/__ptrace.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__ptrace)
ldr r7, =__NR_ptrace
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__ptrace)
diff --git a/libc/arch-arm/syscalls/__reboot.S b/libc/arch-arm/syscalls/__reboot.S
index 07898a05a..8dd57d6b8 100644
--- a/libc/arch-arm/syscalls/__reboot.S
+++ b/libc/arch-arm/syscalls/__reboot.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__reboot)
ldr r7, =__NR_reboot
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__reboot)
diff --git a/libc/arch-arm/syscalls/__rt_sigaction.S b/libc/arch-arm/syscalls/__rt_sigaction.S
index 31d4c1e61..7955e13b1 100644
--- a/libc/arch-arm/syscalls/__rt_sigaction.S
+++ b/libc/arch-arm/syscalls/__rt_sigaction.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__rt_sigaction)
ldr r7, =__NR_rt_sigaction
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__rt_sigaction)
diff --git a/libc/arch-arm/syscalls/__rt_sigprocmask.S b/libc/arch-arm/syscalls/__rt_sigprocmask.S
index 640a7ee34..c40ace8c9 100644
--- a/libc/arch-arm/syscalls/__rt_sigprocmask.S
+++ b/libc/arch-arm/syscalls/__rt_sigprocmask.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__rt_sigprocmask)
ldr r7, =__NR_rt_sigprocmask
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__rt_sigprocmask)
diff --git a/libc/arch-arm/syscalls/__rt_sigtimedwait.S b/libc/arch-arm/syscalls/__rt_sigtimedwait.S
index ad725afa6..dfd23e8a8 100644
--- a/libc/arch-arm/syscalls/__rt_sigtimedwait.S
+++ b/libc/arch-arm/syscalls/__rt_sigtimedwait.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__rt_sigtimedwait)
ldr r7, =__NR_rt_sigtimedwait
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__rt_sigtimedwait)
diff --git a/libc/arch-arm/syscalls/__sched_getaffinity.S b/libc/arch-arm/syscalls/__sched_getaffinity.S
index bee167455..5c241b5a9 100644
--- a/libc/arch-arm/syscalls/__sched_getaffinity.S
+++ b/libc/arch-arm/syscalls/__sched_getaffinity.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__sched_getaffinity)
ldr r7, =__NR_sched_getaffinity
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__sched_getaffinity)
diff --git a/libc/arch-arm/syscalls/__set_tls.S b/libc/arch-arm/syscalls/__set_tls.S
index 3039b3505..909c4b344 100644
--- a/libc/arch-arm/syscalls/__set_tls.S
+++ b/libc/arch-arm/syscalls/__set_tls.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__set_tls)
ldr r7, =__NR_ARM_set_tls
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__set_tls)
diff --git a/libc/arch-arm/syscalls/__setresuid.S b/libc/arch-arm/syscalls/__setresuid.S
index 1877bbfac..baa5f30fd 100644
--- a/libc/arch-arm/syscalls/__setresuid.S
+++ b/libc/arch-arm/syscalls/__setresuid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__setresuid)
ldr r7, =__NR_setresuid32
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__setresuid)
diff --git a/libc/arch-arm/syscalls/__setreuid.S b/libc/arch-arm/syscalls/__setreuid.S
index 2129cb212..660bd2e58 100644
--- a/libc/arch-arm/syscalls/__setreuid.S
+++ b/libc/arch-arm/syscalls/__setreuid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__setreuid)
ldr r7, =__NR_setreuid32
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__setreuid)
diff --git a/libc/arch-arm/syscalls/__setuid.S b/libc/arch-arm/syscalls/__setuid.S
index 9df2f89c4..fa9843238 100644
--- a/libc/arch-arm/syscalls/__setuid.S
+++ b/libc/arch-arm/syscalls/__setuid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__setuid)
ldr r7, =__NR_setuid32
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__setuid)
diff --git a/libc/arch-arm/syscalls/__sigsuspend.S b/libc/arch-arm/syscalls/__sigsuspend.S
index 8f1ff55c6..0ef0c54d0 100644
--- a/libc/arch-arm/syscalls/__sigsuspend.S
+++ b/libc/arch-arm/syscalls/__sigsuspend.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__sigsuspend)
ldr r7, =__NR_sigsuspend
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__sigsuspend)
diff --git a/libc/arch-arm/syscalls/__statfs64.S b/libc/arch-arm/syscalls/__statfs64.S
index f8d63a3a0..577700a02 100644
--- a/libc/arch-arm/syscalls/__statfs64.S
+++ b/libc/arch-arm/syscalls/__statfs64.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__statfs64)
ldr r7, =__NR_statfs64
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__statfs64)
diff --git a/libc/arch-arm/syscalls/__sys_clone.S b/libc/arch-arm/syscalls/__sys_clone.S
index 48046bc74..56712e40e 100644
--- a/libc/arch-arm/syscalls/__sys_clone.S
+++ b/libc/arch-arm/syscalls/__sys_clone.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(__sys_clone)
ldr r7, =__NR_clone
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__sys_clone)
diff --git a/libc/arch-arm/syscalls/__syslog.S b/libc/arch-arm/syscalls/__syslog.S
index 8ad027122..dbd326851 100644
--- a/libc/arch-arm/syscalls/__syslog.S
+++ b/libc/arch-arm/syscalls/__syslog.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__syslog)
ldr r7, =__NR_syslog
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__syslog)
diff --git a/libc/arch-arm/syscalls/__timer_create.S b/libc/arch-arm/syscalls/__timer_create.S
index fcb4e3f2c..6e5e64701 100644
--- a/libc/arch-arm/syscalls/__timer_create.S
+++ b/libc/arch-arm/syscalls/__timer_create.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__timer_create)
ldr r7, =__NR_timer_create
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__timer_create)
diff --git a/libc/arch-arm/syscalls/__timer_delete.S b/libc/arch-arm/syscalls/__timer_delete.S
index de303fc33..ff6c76256 100644
--- a/libc/arch-arm/syscalls/__timer_delete.S
+++ b/libc/arch-arm/syscalls/__timer_delete.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__timer_delete)
ldr r7, =__NR_timer_delete
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__timer_delete)
diff --git a/libc/arch-arm/syscalls/__timer_getoverrun.S b/libc/arch-arm/syscalls/__timer_getoverrun.S
index a96b047aa..39b075525 100644
--- a/libc/arch-arm/syscalls/__timer_getoverrun.S
+++ b/libc/arch-arm/syscalls/__timer_getoverrun.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__timer_getoverrun)
ldr r7, =__NR_timer_getoverrun
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__timer_getoverrun)
diff --git a/libc/arch-arm/syscalls/__timer_gettime.S b/libc/arch-arm/syscalls/__timer_gettime.S
index 6e6bbf54e..d079ffdad 100644
--- a/libc/arch-arm/syscalls/__timer_gettime.S
+++ b/libc/arch-arm/syscalls/__timer_gettime.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__timer_gettime)
ldr r7, =__NR_timer_gettime
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__timer_gettime)
diff --git a/libc/arch-arm/syscalls/__timer_settime.S b/libc/arch-arm/syscalls/__timer_settime.S
index bcbe298ea..663082b4c 100644
--- a/libc/arch-arm/syscalls/__timer_settime.S
+++ b/libc/arch-arm/syscalls/__timer_settime.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__timer_settime)
ldr r7, =__NR_timer_settime
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__timer_settime)
diff --git a/libc/arch-arm/syscalls/__wait4.S b/libc/arch-arm/syscalls/__wait4.S
index 2a0e5c4db..ac5904535 100644
--- a/libc/arch-arm/syscalls/__wait4.S
+++ b/libc/arch-arm/syscalls/__wait4.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(__wait4)
ldr r7, =__NR_wait4
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__wait4)
diff --git a/libc/arch-arm/syscalls/__waitid.S b/libc/arch-arm/syscalls/__waitid.S
index 9950e9c3c..d98d9d663 100644
--- a/libc/arch-arm/syscalls/__waitid.S
+++ b/libc/arch-arm/syscalls/__waitid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(__waitid)
ldr r7, =__NR_waitid
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(__waitid)
diff --git a/libc/arch-arm/syscalls/_exit.S b/libc/arch-arm/syscalls/_exit.S
index ab444ce3e..9c3a9f8b5 100644
--- a/libc/arch-arm/syscalls/_exit.S
+++ b/libc/arch-arm/syscalls/_exit.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(_exit)
ldr r7, =__NR_exit_group
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(_exit)
diff --git a/libc/arch-arm/syscalls/_exit_thread.S b/libc/arch-arm/syscalls/_exit_thread.S
index 53a21fb93..4e017006d 100644
--- a/libc/arch-arm/syscalls/_exit_thread.S
+++ b/libc/arch-arm/syscalls/_exit_thread.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(_exit_thread)
ldr r7, =__NR_exit
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(_exit_thread)
diff --git a/libc/arch-arm/syscalls/accept.S b/libc/arch-arm/syscalls/accept.S
index b1a2d72db..17e17effc 100644
--- a/libc/arch-arm/syscalls/accept.S
+++ b/libc/arch-arm/syscalls/accept.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(accept)
ldr r7, =__NR_accept
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(accept)
diff --git a/libc/arch-arm/syscalls/access.S b/libc/arch-arm/syscalls/access.S
index c0b033320..2604c0c84 100644
--- a/libc/arch-arm/syscalls/access.S
+++ b/libc/arch-arm/syscalls/access.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(access)
ldr r7, =__NR_access
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(access)
diff --git a/libc/arch-arm/syscalls/acct.S b/libc/arch-arm/syscalls/acct.S
index 5485be1cb..a8f7e5c85 100644
--- a/libc/arch-arm/syscalls/acct.S
+++ b/libc/arch-arm/syscalls/acct.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(acct)
ldr r7, =__NR_acct
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(acct)
diff --git a/libc/arch-arm/syscalls/bind.S b/libc/arch-arm/syscalls/bind.S
index 1bb58436b..4e071eb2a 100644
--- a/libc/arch-arm/syscalls/bind.S
+++ b/libc/arch-arm/syscalls/bind.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(bind)
ldr r7, =__NR_bind
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(bind)
diff --git a/libc/arch-arm/syscalls/cacheflush.S b/libc/arch-arm/syscalls/cacheflush.S
index fd7f68d31..ed233e84d 100644
--- a/libc/arch-arm/syscalls/cacheflush.S
+++ b/libc/arch-arm/syscalls/cacheflush.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(cacheflush)
ldr r7, =__NR_ARM_cacheflush
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(cacheflush)
diff --git a/libc/arch-arm/syscalls/capget.S b/libc/arch-arm/syscalls/capget.S
index 1f425a026..ac297ede8 100644
--- a/libc/arch-arm/syscalls/capget.S
+++ b/libc/arch-arm/syscalls/capget.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(capget)
ldr r7, =__NR_capget
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(capget)
diff --git a/libc/arch-arm/syscalls/capset.S b/libc/arch-arm/syscalls/capset.S
index 13ebd5a27..c6b043fa8 100644
--- a/libc/arch-arm/syscalls/capset.S
+++ b/libc/arch-arm/syscalls/capset.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(capset)
ldr r7, =__NR_capset
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(capset)
diff --git a/libc/arch-arm/syscalls/chdir.S b/libc/arch-arm/syscalls/chdir.S
index 4965495aa..e59c3a011 100644
--- a/libc/arch-arm/syscalls/chdir.S
+++ b/libc/arch-arm/syscalls/chdir.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(chdir)
ldr r7, =__NR_chdir
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(chdir)
diff --git a/libc/arch-arm/syscalls/chmod.S b/libc/arch-arm/syscalls/chmod.S
index ed9d52fba..fb0489e4d 100644
--- a/libc/arch-arm/syscalls/chmod.S
+++ b/libc/arch-arm/syscalls/chmod.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(chmod)
ldr r7, =__NR_chmod
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(chmod)
diff --git a/libc/arch-arm/syscalls/chown.S b/libc/arch-arm/syscalls/chown.S
index ff1cec289..41c90a611 100644
--- a/libc/arch-arm/syscalls/chown.S
+++ b/libc/arch-arm/syscalls/chown.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(chown)
ldr r7, =__NR_chown32
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(chown)
diff --git a/libc/arch-arm/syscalls/chroot.S b/libc/arch-arm/syscalls/chroot.S
index bc8e3fe83..a68f5137b 100644
--- a/libc/arch-arm/syscalls/chroot.S
+++ b/libc/arch-arm/syscalls/chroot.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(chroot)
ldr r7, =__NR_chroot
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(chroot)
diff --git a/libc/arch-arm/syscalls/clock_getres.S b/libc/arch-arm/syscalls/clock_getres.S
index 66cf9ece8..bf6226cf0 100644
--- a/libc/arch-arm/syscalls/clock_getres.S
+++ b/libc/arch-arm/syscalls/clock_getres.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(clock_getres)
ldr r7, =__NR_clock_getres
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(clock_getres)
diff --git a/libc/arch-arm/syscalls/clock_gettime.S b/libc/arch-arm/syscalls/clock_gettime.S
index 4e42c820f..35bfe0a24 100644
--- a/libc/arch-arm/syscalls/clock_gettime.S
+++ b/libc/arch-arm/syscalls/clock_gettime.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(clock_gettime)
ldr r7, =__NR_clock_gettime
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(clock_gettime)
diff --git a/libc/arch-arm/syscalls/clock_nanosleep.S b/libc/arch-arm/syscalls/clock_nanosleep.S
index 6d530a21f..34137ab6b 100644
--- a/libc/arch-arm/syscalls/clock_nanosleep.S
+++ b/libc/arch-arm/syscalls/clock_nanosleep.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(clock_nanosleep)
ldr r7, =__NR_clock_nanosleep
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(clock_nanosleep)
diff --git a/libc/arch-arm/syscalls/clock_settime.S b/libc/arch-arm/syscalls/clock_settime.S
index e9374b5ee..94c0fbe04 100644
--- a/libc/arch-arm/syscalls/clock_settime.S
+++ b/libc/arch-arm/syscalls/clock_settime.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(clock_settime)
ldr r7, =__NR_clock_settime
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(clock_settime)
diff --git a/libc/arch-arm/syscalls/close.S b/libc/arch-arm/syscalls/close.S
index eb4cb6286..f595025f7 100644
--- a/libc/arch-arm/syscalls/close.S
+++ b/libc/arch-arm/syscalls/close.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(close)
ldr r7, =__NR_close
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(close)
diff --git a/libc/arch-arm/syscalls/connect.S b/libc/arch-arm/syscalls/connect.S
index b97b4fe3c..1e7b7f9ea 100644
--- a/libc/arch-arm/syscalls/connect.S
+++ b/libc/arch-arm/syscalls/connect.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(connect)
ldr r7, =__NR_connect
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(connect)
diff --git a/libc/arch-arm/syscalls/delete_module.S b/libc/arch-arm/syscalls/delete_module.S
index 09949943e..122a3400f 100644
--- a/libc/arch-arm/syscalls/delete_module.S
+++ b/libc/arch-arm/syscalls/delete_module.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(delete_module)
ldr r7, =__NR_delete_module
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(delete_module)
diff --git a/libc/arch-arm/syscalls/dup.S b/libc/arch-arm/syscalls/dup.S
index 88543420c..e8272a765 100644
--- a/libc/arch-arm/syscalls/dup.S
+++ b/libc/arch-arm/syscalls/dup.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(dup)
ldr r7, =__NR_dup
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(dup)
diff --git a/libc/arch-arm/syscalls/dup2.S b/libc/arch-arm/syscalls/dup2.S
index 0dcc57fc7..b0ec0071e 100644
--- a/libc/arch-arm/syscalls/dup2.S
+++ b/libc/arch-arm/syscalls/dup2.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(dup2)
ldr r7, =__NR_dup2
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(dup2)
diff --git a/libc/arch-arm/syscalls/epoll_create.S b/libc/arch-arm/syscalls/epoll_create.S
index 92a2781f7..bb8d288c5 100644
--- a/libc/arch-arm/syscalls/epoll_create.S
+++ b/libc/arch-arm/syscalls/epoll_create.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(epoll_create)
ldr r7, =__NR_epoll_create
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(epoll_create)
diff --git a/libc/arch-arm/syscalls/epoll_ctl.S b/libc/arch-arm/syscalls/epoll_ctl.S
index b3c630fd0..255ac6f2d 100644
--- a/libc/arch-arm/syscalls/epoll_ctl.S
+++ b/libc/arch-arm/syscalls/epoll_ctl.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(epoll_ctl)
ldr r7, =__NR_epoll_ctl
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(epoll_ctl)
diff --git a/libc/arch-arm/syscalls/epoll_wait.S b/libc/arch-arm/syscalls/epoll_wait.S
index 3ccac918c..1ebeaabdc 100644
--- a/libc/arch-arm/syscalls/epoll_wait.S
+++ b/libc/arch-arm/syscalls/epoll_wait.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(epoll_wait)
ldr r7, =__NR_epoll_wait
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(epoll_wait)
diff --git a/libc/arch-arm/syscalls/eventfd.S b/libc/arch-arm/syscalls/eventfd.S
index 754f019fc..96ead5121 100644
--- a/libc/arch-arm/syscalls/eventfd.S
+++ b/libc/arch-arm/syscalls/eventfd.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(eventfd)
ldr r7, =__NR_eventfd2
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(eventfd)
diff --git a/libc/arch-arm/syscalls/execve.S b/libc/arch-arm/syscalls/execve.S
index 49e5b13f5..5b74109a5 100644
--- a/libc/arch-arm/syscalls/execve.S
+++ b/libc/arch-arm/syscalls/execve.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(execve)
ldr r7, =__NR_execve
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(execve)
diff --git a/libc/arch-arm/syscalls/faccessat.S b/libc/arch-arm/syscalls/faccessat.S
index 5ade5177b..abc895f1b 100644
--- a/libc/arch-arm/syscalls/faccessat.S
+++ b/libc/arch-arm/syscalls/faccessat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(faccessat)
ldr r7, =__NR_faccessat
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(faccessat)
diff --git a/libc/arch-arm/syscalls/fchdir.S b/libc/arch-arm/syscalls/fchdir.S
index 96a047dda..b52627aca 100644
--- a/libc/arch-arm/syscalls/fchdir.S
+++ b/libc/arch-arm/syscalls/fchdir.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(fchdir)
ldr r7, =__NR_fchdir
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(fchdir)
diff --git a/libc/arch-arm/syscalls/fchmod.S b/libc/arch-arm/syscalls/fchmod.S
index b096a8c17..6acd482f4 100644
--- a/libc/arch-arm/syscalls/fchmod.S
+++ b/libc/arch-arm/syscalls/fchmod.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(fchmod)
ldr r7, =__NR_fchmod
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(fchmod)
diff --git a/libc/arch-arm/syscalls/fchmodat.S b/libc/arch-arm/syscalls/fchmodat.S
index 8c87598cc..09a35690b 100644
--- a/libc/arch-arm/syscalls/fchmodat.S
+++ b/libc/arch-arm/syscalls/fchmodat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(fchmodat)
ldr r7, =__NR_fchmodat
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(fchmodat)
diff --git a/libc/arch-arm/syscalls/fchown.S b/libc/arch-arm/syscalls/fchown.S
index 2f7e92bc0..08d996ec5 100644
--- a/libc/arch-arm/syscalls/fchown.S
+++ b/libc/arch-arm/syscalls/fchown.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(fchown)
ldr r7, =__NR_fchown32
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(fchown)
diff --git a/libc/arch-arm/syscalls/fchownat.S b/libc/arch-arm/syscalls/fchownat.S
index 148283263..f5061ec6b 100644
--- a/libc/arch-arm/syscalls/fchownat.S
+++ b/libc/arch-arm/syscalls/fchownat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(fchownat)
ldr r7, =__NR_fchownat
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(fchownat)
diff --git a/libc/arch-arm/syscalls/fdatasync.S b/libc/arch-arm/syscalls/fdatasync.S
index 31818c889..b456fb473 100644
--- a/libc/arch-arm/syscalls/fdatasync.S
+++ b/libc/arch-arm/syscalls/fdatasync.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(fdatasync)
ldr r7, =__NR_fdatasync
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(fdatasync)
diff --git a/libc/arch-arm/syscalls/fgetxattr.S b/libc/arch-arm/syscalls/fgetxattr.S
index 6f3eb3dac..6cabf9f29 100644
--- a/libc/arch-arm/syscalls/fgetxattr.S
+++ b/libc/arch-arm/syscalls/fgetxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(fgetxattr)
ldr r7, =__NR_fgetxattr
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(fgetxattr)
diff --git a/libc/arch-arm/syscalls/flistxattr.S b/libc/arch-arm/syscalls/flistxattr.S
index 38e856d0b..e912e91c4 100644
--- a/libc/arch-arm/syscalls/flistxattr.S
+++ b/libc/arch-arm/syscalls/flistxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(flistxattr)
ldr r7, =__NR_flistxattr
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(flistxattr)
diff --git a/libc/arch-arm/syscalls/flock.S b/libc/arch-arm/syscalls/flock.S
index 3732bfe85..572d28cc1 100644
--- a/libc/arch-arm/syscalls/flock.S
+++ b/libc/arch-arm/syscalls/flock.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(flock)
ldr r7, =__NR_flock
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(flock)
diff --git a/libc/arch-arm/syscalls/fremovexattr.S b/libc/arch-arm/syscalls/fremovexattr.S
index 45cf803a7..485886de3 100644
--- a/libc/arch-arm/syscalls/fremovexattr.S
+++ b/libc/arch-arm/syscalls/fremovexattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(fremovexattr)
ldr r7, =__NR_fremovexattr
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(fremovexattr)
diff --git a/libc/arch-arm/syscalls/fsetxattr.S b/libc/arch-arm/syscalls/fsetxattr.S
index 176cad99e..29526e75e 100644
--- a/libc/arch-arm/syscalls/fsetxattr.S
+++ b/libc/arch-arm/syscalls/fsetxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(fsetxattr)
ldr r7, =__NR_fsetxattr
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(fsetxattr)
diff --git a/libc/arch-arm/syscalls/fstat.S b/libc/arch-arm/syscalls/fstat.S
index d31421339..903c5c22c 100644
--- a/libc/arch-arm/syscalls/fstat.S
+++ b/libc/arch-arm/syscalls/fstat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(fstat)
ldr r7, =__NR_fstat64
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(fstat)
diff --git a/libc/arch-arm/syscalls/fstatat.S b/libc/arch-arm/syscalls/fstatat.S
index 8cf1a5718..030ee31f2 100644
--- a/libc/arch-arm/syscalls/fstatat.S
+++ b/libc/arch-arm/syscalls/fstatat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(fstatat)
ldr r7, =__NR_fstatat64
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(fstatat)
diff --git a/libc/arch-arm/syscalls/fsync.S b/libc/arch-arm/syscalls/fsync.S
index 52cfa539a..144b64bd8 100644
--- a/libc/arch-arm/syscalls/fsync.S
+++ b/libc/arch-arm/syscalls/fsync.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(fsync)
ldr r7, =__NR_fsync
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(fsync)
diff --git a/libc/arch-arm/syscalls/ftruncate.S b/libc/arch-arm/syscalls/ftruncate.S
index 14cd87df4..e2c5e79cc 100644
--- a/libc/arch-arm/syscalls/ftruncate.S
+++ b/libc/arch-arm/syscalls/ftruncate.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(ftruncate)
ldr r7, =__NR_ftruncate
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(ftruncate)
diff --git a/libc/arch-arm/syscalls/ftruncate64.S b/libc/arch-arm/syscalls/ftruncate64.S
index 0e1b42b98..19b02b685 100644
--- a/libc/arch-arm/syscalls/ftruncate64.S
+++ b/libc/arch-arm/syscalls/ftruncate64.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(ftruncate64)
ldr r7, =__NR_ftruncate64
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(ftruncate64)
diff --git a/libc/arch-arm/syscalls/futex.S b/libc/arch-arm/syscalls/futex.S
index 47219e30c..b012cd7dd 100644
--- a/libc/arch-arm/syscalls/futex.S
+++ b/libc/arch-arm/syscalls/futex.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(futex)
ldr r7, =__NR_futex
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(futex)
diff --git a/libc/arch-arm/syscalls/getdents.S b/libc/arch-arm/syscalls/getdents.S
index e6c3028bd..cb240eadd 100644
--- a/libc/arch-arm/syscalls/getdents.S
+++ b/libc/arch-arm/syscalls/getdents.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(getdents)
ldr r7, =__NR_getdents64
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getdents)
diff --git a/libc/arch-arm/syscalls/getegid.S b/libc/arch-arm/syscalls/getegid.S
index 22794d19b..4386c2efd 100644
--- a/libc/arch-arm/syscalls/getegid.S
+++ b/libc/arch-arm/syscalls/getegid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(getegid)
ldr r7, =__NR_getegid32
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getegid)
diff --git a/libc/arch-arm/syscalls/geteuid.S b/libc/arch-arm/syscalls/geteuid.S
index cfb318f69..afe99ee6e 100644
--- a/libc/arch-arm/syscalls/geteuid.S
+++ b/libc/arch-arm/syscalls/geteuid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(geteuid)
ldr r7, =__NR_geteuid32
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(geteuid)
diff --git a/libc/arch-arm/syscalls/getgid.S b/libc/arch-arm/syscalls/getgid.S
index 085061e0e..f9b6c9ed5 100644
--- a/libc/arch-arm/syscalls/getgid.S
+++ b/libc/arch-arm/syscalls/getgid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(getgid)
ldr r7, =__NR_getgid32
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getgid)
diff --git a/libc/arch-arm/syscalls/getgroups.S b/libc/arch-arm/syscalls/getgroups.S
index c426d8728..ab8e8a1f9 100644
--- a/libc/arch-arm/syscalls/getgroups.S
+++ b/libc/arch-arm/syscalls/getgroups.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(getgroups)
ldr r7, =__NR_getgroups32
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getgroups)
diff --git a/libc/arch-arm/syscalls/getitimer.S b/libc/arch-arm/syscalls/getitimer.S
index 5d832d99b..6300cdb88 100644
--- a/libc/arch-arm/syscalls/getitimer.S
+++ b/libc/arch-arm/syscalls/getitimer.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(getitimer)
ldr r7, =__NR_getitimer
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getitimer)
diff --git a/libc/arch-arm/syscalls/getpeername.S b/libc/arch-arm/syscalls/getpeername.S
index ced69f7d5..f031470cf 100644
--- a/libc/arch-arm/syscalls/getpeername.S
+++ b/libc/arch-arm/syscalls/getpeername.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(getpeername)
ldr r7, =__NR_getpeername
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getpeername)
diff --git a/libc/arch-arm/syscalls/getpgid.S b/libc/arch-arm/syscalls/getpgid.S
index d599f1e40..60e4589ff 100644
--- a/libc/arch-arm/syscalls/getpgid.S
+++ b/libc/arch-arm/syscalls/getpgid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(getpgid)
ldr r7, =__NR_getpgid
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getpgid)
diff --git a/libc/arch-arm/syscalls/getpid.S b/libc/arch-arm/syscalls/getpid.S
index ef19d2593..ff8eebb63 100644
--- a/libc/arch-arm/syscalls/getpid.S
+++ b/libc/arch-arm/syscalls/getpid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(getpid)
ldr r7, =__NR_getpid
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getpid)
diff --git a/libc/arch-arm/syscalls/getppid.S b/libc/arch-arm/syscalls/getppid.S
index 1fe30d48d..b770e8dfa 100644
--- a/libc/arch-arm/syscalls/getppid.S
+++ b/libc/arch-arm/syscalls/getppid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(getppid)
ldr r7, =__NR_getppid
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getppid)
diff --git a/libc/arch-arm/syscalls/getresgid.S b/libc/arch-arm/syscalls/getresgid.S
index e8d2129f5..2e7949a4a 100644
--- a/libc/arch-arm/syscalls/getresgid.S
+++ b/libc/arch-arm/syscalls/getresgid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(getresgid)
ldr r7, =__NR_getresgid32
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getresgid)
diff --git a/libc/arch-arm/syscalls/getresuid.S b/libc/arch-arm/syscalls/getresuid.S
index cdfe0f7c7..e006c8bde 100644
--- a/libc/arch-arm/syscalls/getresuid.S
+++ b/libc/arch-arm/syscalls/getresuid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(getresuid)
ldr r7, =__NR_getresuid32
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getresuid)
diff --git a/libc/arch-arm/syscalls/getrlimit.S b/libc/arch-arm/syscalls/getrlimit.S
index 3acbf9593..73efb8da6 100644
--- a/libc/arch-arm/syscalls/getrlimit.S
+++ b/libc/arch-arm/syscalls/getrlimit.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(getrlimit)
ldr r7, =__NR_ugetrlimit
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getrlimit)
diff --git a/libc/arch-arm/syscalls/getrusage.S b/libc/arch-arm/syscalls/getrusage.S
index e17fc4a8b..56596127c 100644
--- a/libc/arch-arm/syscalls/getrusage.S
+++ b/libc/arch-arm/syscalls/getrusage.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(getrusage)
ldr r7, =__NR_getrusage
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getrusage)
diff --git a/libc/arch-arm/syscalls/getsid.S b/libc/arch-arm/syscalls/getsid.S
index 06e6d6789..3e63e5099 100644
--- a/libc/arch-arm/syscalls/getsid.S
+++ b/libc/arch-arm/syscalls/getsid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(getsid)
ldr r7, =__NR_getsid
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getsid)
diff --git a/libc/arch-arm/syscalls/getsockname.S b/libc/arch-arm/syscalls/getsockname.S
index 458814fd7..08d86a9a9 100644
--- a/libc/arch-arm/syscalls/getsockname.S
+++ b/libc/arch-arm/syscalls/getsockname.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(getsockname)
ldr r7, =__NR_getsockname
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getsockname)
diff --git a/libc/arch-arm/syscalls/getsockopt.S b/libc/arch-arm/syscalls/getsockopt.S
index d52f441eb..5a18c52be 100644
--- a/libc/arch-arm/syscalls/getsockopt.S
+++ b/libc/arch-arm/syscalls/getsockopt.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(getsockopt)
ldr r7, =__NR_getsockopt
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getsockopt)
diff --git a/libc/arch-arm/syscalls/gettid.S b/libc/arch-arm/syscalls/gettid.S
index f35c7eac3..36e015a65 100644
--- a/libc/arch-arm/syscalls/gettid.S
+++ b/libc/arch-arm/syscalls/gettid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(gettid)
ldr r7, =__NR_gettid
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(gettid)
diff --git a/libc/arch-arm/syscalls/gettimeofday.S b/libc/arch-arm/syscalls/gettimeofday.S
index 113413e50..d880224b2 100644
--- a/libc/arch-arm/syscalls/gettimeofday.S
+++ b/libc/arch-arm/syscalls/gettimeofday.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(gettimeofday)
ldr r7, =__NR_gettimeofday
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(gettimeofday)
diff --git a/libc/arch-arm/syscalls/getuid.S b/libc/arch-arm/syscalls/getuid.S
index 20ed7f982..27ee92308 100644
--- a/libc/arch-arm/syscalls/getuid.S
+++ b/libc/arch-arm/syscalls/getuid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(getuid)
ldr r7, =__NR_getuid32
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getuid)
diff --git a/libc/arch-arm/syscalls/getxattr.S b/libc/arch-arm/syscalls/getxattr.S
index 0a7cbef3a..c6c74418f 100644
--- a/libc/arch-arm/syscalls/getxattr.S
+++ b/libc/arch-arm/syscalls/getxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(getxattr)
ldr r7, =__NR_getxattr
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(getxattr)
diff --git a/libc/arch-arm/syscalls/init_module.S b/libc/arch-arm/syscalls/init_module.S
index de41a7e44..a18762939 100644
--- a/libc/arch-arm/syscalls/init_module.S
+++ b/libc/arch-arm/syscalls/init_module.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(init_module)
ldr r7, =__NR_init_module
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(init_module)
diff --git a/libc/arch-arm/syscalls/inotify_add_watch.S b/libc/arch-arm/syscalls/inotify_add_watch.S
index aa8fcb7f2..48eb8d838 100644
--- a/libc/arch-arm/syscalls/inotify_add_watch.S
+++ b/libc/arch-arm/syscalls/inotify_add_watch.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(inotify_add_watch)
ldr r7, =__NR_inotify_add_watch
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(inotify_add_watch)
diff --git a/libc/arch-arm/syscalls/inotify_init.S b/libc/arch-arm/syscalls/inotify_init.S
index 56d4b9394..9a11610ff 100644
--- a/libc/arch-arm/syscalls/inotify_init.S
+++ b/libc/arch-arm/syscalls/inotify_init.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(inotify_init)
ldr r7, =__NR_inotify_init
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(inotify_init)
diff --git a/libc/arch-arm/syscalls/inotify_rm_watch.S b/libc/arch-arm/syscalls/inotify_rm_watch.S
index 431506108..2d96f62e2 100644
--- a/libc/arch-arm/syscalls/inotify_rm_watch.S
+++ b/libc/arch-arm/syscalls/inotify_rm_watch.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(inotify_rm_watch)
ldr r7, =__NR_inotify_rm_watch
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(inotify_rm_watch)
diff --git a/libc/arch-arm/syscalls/ioprio_get.S b/libc/arch-arm/syscalls/ioprio_get.S
index d3bd7968a..58c6909d7 100644
--- a/libc/arch-arm/syscalls/ioprio_get.S
+++ b/libc/arch-arm/syscalls/ioprio_get.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(ioprio_get)
ldr r7, =__NR_ioprio_get
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(ioprio_get)
diff --git a/libc/arch-arm/syscalls/ioprio_set.S b/libc/arch-arm/syscalls/ioprio_set.S
index c42d3051e..3afcfa188 100644
--- a/libc/arch-arm/syscalls/ioprio_set.S
+++ b/libc/arch-arm/syscalls/ioprio_set.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(ioprio_set)
ldr r7, =__NR_ioprio_set
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(ioprio_set)
diff --git a/libc/arch-arm/syscalls/klogctl.S b/libc/arch-arm/syscalls/klogctl.S
index 13568156c..d3db0d212 100644
--- a/libc/arch-arm/syscalls/klogctl.S
+++ b/libc/arch-arm/syscalls/klogctl.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(klogctl)
ldr r7, =__NR_syslog
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(klogctl)
diff --git a/libc/arch-arm/syscalls/lchown.S b/libc/arch-arm/syscalls/lchown.S
index 56902a312..1b0ab5346 100644
--- a/libc/arch-arm/syscalls/lchown.S
+++ b/libc/arch-arm/syscalls/lchown.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(lchown)
ldr r7, =__NR_lchown32
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(lchown)
diff --git a/libc/arch-arm/syscalls/lgetxattr.S b/libc/arch-arm/syscalls/lgetxattr.S
index cc30d63e3..a9a04274c 100644
--- a/libc/arch-arm/syscalls/lgetxattr.S
+++ b/libc/arch-arm/syscalls/lgetxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(lgetxattr)
ldr r7, =__NR_lgetxattr
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(lgetxattr)
diff --git a/libc/arch-arm/syscalls/link.S b/libc/arch-arm/syscalls/link.S
index dab8fa69d..6bcaa7723 100644
--- a/libc/arch-arm/syscalls/link.S
+++ b/libc/arch-arm/syscalls/link.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(link)
ldr r7, =__NR_link
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(link)
diff --git a/libc/arch-arm/syscalls/listen.S b/libc/arch-arm/syscalls/listen.S
index fac37024c..33da94cce 100644
--- a/libc/arch-arm/syscalls/listen.S
+++ b/libc/arch-arm/syscalls/listen.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(listen)
ldr r7, =__NR_listen
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(listen)
diff --git a/libc/arch-arm/syscalls/listxattr.S b/libc/arch-arm/syscalls/listxattr.S
index 8c7fc9b83..33af17bf8 100644
--- a/libc/arch-arm/syscalls/listxattr.S
+++ b/libc/arch-arm/syscalls/listxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(listxattr)
ldr r7, =__NR_listxattr
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(listxattr)
diff --git a/libc/arch-arm/syscalls/llistxattr.S b/libc/arch-arm/syscalls/llistxattr.S
index 9cade1805..332af2ad2 100644
--- a/libc/arch-arm/syscalls/llistxattr.S
+++ b/libc/arch-arm/syscalls/llistxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(llistxattr)
ldr r7, =__NR_llistxattr
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(llistxattr)
diff --git a/libc/arch-arm/syscalls/lremovexattr.S b/libc/arch-arm/syscalls/lremovexattr.S
index d4a7b8212..57ae42439 100644
--- a/libc/arch-arm/syscalls/lremovexattr.S
+++ b/libc/arch-arm/syscalls/lremovexattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(lremovexattr)
ldr r7, =__NR_lremovexattr
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(lremovexattr)
diff --git a/libc/arch-arm/syscalls/lseek.S b/libc/arch-arm/syscalls/lseek.S
index a45285611..0b9dda27c 100644
--- a/libc/arch-arm/syscalls/lseek.S
+++ b/libc/arch-arm/syscalls/lseek.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(lseek)
ldr r7, =__NR_lseek
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(lseek)
diff --git a/libc/arch-arm/syscalls/lsetxattr.S b/libc/arch-arm/syscalls/lsetxattr.S
index bde7c249b..af5dce866 100644
--- a/libc/arch-arm/syscalls/lsetxattr.S
+++ b/libc/arch-arm/syscalls/lsetxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(lsetxattr)
ldr r7, =__NR_lsetxattr
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(lsetxattr)
diff --git a/libc/arch-arm/syscalls/lstat.S b/libc/arch-arm/syscalls/lstat.S
index 69f21461f..f90ab738d 100644
--- a/libc/arch-arm/syscalls/lstat.S
+++ b/libc/arch-arm/syscalls/lstat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(lstat)
ldr r7, =__NR_lstat64
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(lstat)
diff --git a/libc/arch-arm/syscalls/madvise.S b/libc/arch-arm/syscalls/madvise.S
index 02944a2bd..33f1b3d3e 100644
--- a/libc/arch-arm/syscalls/madvise.S
+++ b/libc/arch-arm/syscalls/madvise.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(madvise)
ldr r7, =__NR_madvise
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(madvise)
diff --git a/libc/arch-arm/syscalls/mincore.S b/libc/arch-arm/syscalls/mincore.S
index 5ffdc1144..921ad007c 100644
--- a/libc/arch-arm/syscalls/mincore.S
+++ b/libc/arch-arm/syscalls/mincore.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(mincore)
ldr r7, =__NR_mincore
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(mincore)
diff --git a/libc/arch-arm/syscalls/mkdir.S b/libc/arch-arm/syscalls/mkdir.S
index c2aa08034..d71f9c27a 100644
--- a/libc/arch-arm/syscalls/mkdir.S
+++ b/libc/arch-arm/syscalls/mkdir.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(mkdir)
ldr r7, =__NR_mkdir
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(mkdir)
diff --git a/libc/arch-arm/syscalls/mkdirat.S b/libc/arch-arm/syscalls/mkdirat.S
index 421c70a62..ac12d8f57 100644
--- a/libc/arch-arm/syscalls/mkdirat.S
+++ b/libc/arch-arm/syscalls/mkdirat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(mkdirat)
ldr r7, =__NR_mkdirat
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(mkdirat)
diff --git a/libc/arch-arm/syscalls/mknod.S b/libc/arch-arm/syscalls/mknod.S
index 4aca2c557..077af76d2 100644
--- a/libc/arch-arm/syscalls/mknod.S
+++ b/libc/arch-arm/syscalls/mknod.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(mknod)
ldr r7, =__NR_mknod
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(mknod)
diff --git a/libc/arch-arm/syscalls/mlock.S b/libc/arch-arm/syscalls/mlock.S
index 5c8e74d9e..edc6077a3 100644
--- a/libc/arch-arm/syscalls/mlock.S
+++ b/libc/arch-arm/syscalls/mlock.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(mlock)
ldr r7, =__NR_mlock
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(mlock)
diff --git a/libc/arch-arm/syscalls/mlockall.S b/libc/arch-arm/syscalls/mlockall.S
index a89545aa8..42285bbda 100644
--- a/libc/arch-arm/syscalls/mlockall.S
+++ b/libc/arch-arm/syscalls/mlockall.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(mlockall)
ldr r7, =__NR_mlockall
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(mlockall)
diff --git a/libc/arch-arm/syscalls/mount.S b/libc/arch-arm/syscalls/mount.S
index eb1624c3c..b1f41007d 100644
--- a/libc/arch-arm/syscalls/mount.S
+++ b/libc/arch-arm/syscalls/mount.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(mount)
ldr r7, =__NR_mount
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(mount)
diff --git a/libc/arch-arm/syscalls/mprotect.S b/libc/arch-arm/syscalls/mprotect.S
index 06238bfa3..47692a109 100644
--- a/libc/arch-arm/syscalls/mprotect.S
+++ b/libc/arch-arm/syscalls/mprotect.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(mprotect)
ldr r7, =__NR_mprotect
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(mprotect)
diff --git a/libc/arch-arm/syscalls/mremap.S b/libc/arch-arm/syscalls/mremap.S
index 29b308b3d..3b6a75526 100644
--- a/libc/arch-arm/syscalls/mremap.S
+++ b/libc/arch-arm/syscalls/mremap.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(mremap)
ldr r7, =__NR_mremap
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(mremap)
diff --git a/libc/arch-arm/syscalls/msync.S b/libc/arch-arm/syscalls/msync.S
index af8fc0c6f..6100d7a14 100644
--- a/libc/arch-arm/syscalls/msync.S
+++ b/libc/arch-arm/syscalls/msync.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(msync)
ldr r7, =__NR_msync
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(msync)
diff --git a/libc/arch-arm/syscalls/munlock.S b/libc/arch-arm/syscalls/munlock.S
index 42df37e94..52e4f935a 100644
--- a/libc/arch-arm/syscalls/munlock.S
+++ b/libc/arch-arm/syscalls/munlock.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(munlock)
ldr r7, =__NR_munlock
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(munlock)
diff --git a/libc/arch-arm/syscalls/munlockall.S b/libc/arch-arm/syscalls/munlockall.S
index c0fca3312..6c250e193 100644
--- a/libc/arch-arm/syscalls/munlockall.S
+++ b/libc/arch-arm/syscalls/munlockall.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(munlockall)
ldr r7, =__NR_munlockall
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(munlockall)
diff --git a/libc/arch-arm/syscalls/munmap.S b/libc/arch-arm/syscalls/munmap.S
index 9d7b60f38..d07a849c5 100644
--- a/libc/arch-arm/syscalls/munmap.S
+++ b/libc/arch-arm/syscalls/munmap.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(munmap)
ldr r7, =__NR_munmap
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(munmap)
diff --git a/libc/arch-arm/syscalls/nanosleep.S b/libc/arch-arm/syscalls/nanosleep.S
index 7f4cda694..3bd69a9bb 100644
--- a/libc/arch-arm/syscalls/nanosleep.S
+++ b/libc/arch-arm/syscalls/nanosleep.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(nanosleep)
ldr r7, =__NR_nanosleep
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(nanosleep)
diff --git a/libc/arch-arm/syscalls/pause.S b/libc/arch-arm/syscalls/pause.S
index 1238f4bb7..7714fd1ff 100644
--- a/libc/arch-arm/syscalls/pause.S
+++ b/libc/arch-arm/syscalls/pause.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(pause)
ldr r7, =__NR_pause
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(pause)
diff --git a/libc/arch-arm/syscalls/perf_event_open.S b/libc/arch-arm/syscalls/perf_event_open.S
index 39710a5d3..0d055876c 100644
--- a/libc/arch-arm/syscalls/perf_event_open.S
+++ b/libc/arch-arm/syscalls/perf_event_open.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(perf_event_open)
ldr r7, =__NR_perf_event_open
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(perf_event_open)
diff --git a/libc/arch-arm/syscalls/personality.S b/libc/arch-arm/syscalls/personality.S
index f338d7156..f506ed8d9 100644
--- a/libc/arch-arm/syscalls/personality.S
+++ b/libc/arch-arm/syscalls/personality.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(personality)
ldr r7, =__NR_personality
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(personality)
diff --git a/libc/arch-arm/syscalls/pipe.S b/libc/arch-arm/syscalls/pipe.S
index ec0efb1ab..5a6034c42 100644
--- a/libc/arch-arm/syscalls/pipe.S
+++ b/libc/arch-arm/syscalls/pipe.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(pipe)
ldr r7, =__NR_pipe
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(pipe)
diff --git a/libc/arch-arm/syscalls/pipe2.S b/libc/arch-arm/syscalls/pipe2.S
index f79c8f509..a586f495b 100644
--- a/libc/arch-arm/syscalls/pipe2.S
+++ b/libc/arch-arm/syscalls/pipe2.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(pipe2)
ldr r7, =__NR_pipe2
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(pipe2)
diff --git a/libc/arch-arm/syscalls/poll.S b/libc/arch-arm/syscalls/poll.S
index d9831aba4..23cb0a8e4 100644
--- a/libc/arch-arm/syscalls/poll.S
+++ b/libc/arch-arm/syscalls/poll.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(poll)
ldr r7, =__NR_poll
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(poll)
diff --git a/libc/arch-arm/syscalls/prctl.S b/libc/arch-arm/syscalls/prctl.S
index 009dc5428..c650752fc 100644
--- a/libc/arch-arm/syscalls/prctl.S
+++ b/libc/arch-arm/syscalls/prctl.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(prctl)
ldr r7, =__NR_prctl
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(prctl)
diff --git a/libc/arch-arm/syscalls/pread64.S b/libc/arch-arm/syscalls/pread64.S
index 0090fd301..04d36f978 100644
--- a/libc/arch-arm/syscalls/pread64.S
+++ b/libc/arch-arm/syscalls/pread64.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(pread64)
ldr r7, =__NR_pread64
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(pread64)
diff --git a/libc/arch-arm/syscalls/pwrite64.S b/libc/arch-arm/syscalls/pwrite64.S
index 444d78fd4..8a812b336 100644
--- a/libc/arch-arm/syscalls/pwrite64.S
+++ b/libc/arch-arm/syscalls/pwrite64.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(pwrite64)
ldr r7, =__NR_pwrite64
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(pwrite64)
diff --git a/libc/arch-arm/syscalls/read.S b/libc/arch-arm/syscalls/read.S
index ab0583a19..d5e8d081a 100644
--- a/libc/arch-arm/syscalls/read.S
+++ b/libc/arch-arm/syscalls/read.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(read)
ldr r7, =__NR_read
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(read)
diff --git a/libc/arch-arm/syscalls/readahead.S b/libc/arch-arm/syscalls/readahead.S
index 6aa8265ae..90603a4bd 100644
--- a/libc/arch-arm/syscalls/readahead.S
+++ b/libc/arch-arm/syscalls/readahead.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(readahead)
ldr r7, =__NR_readahead
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(readahead)
diff --git a/libc/arch-arm/syscalls/readlink.S b/libc/arch-arm/syscalls/readlink.S
index 90b0ea680..c223e1cda 100644
--- a/libc/arch-arm/syscalls/readlink.S
+++ b/libc/arch-arm/syscalls/readlink.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(readlink)
ldr r7, =__NR_readlink
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(readlink)
diff --git a/libc/arch-arm/syscalls/readv.S b/libc/arch-arm/syscalls/readv.S
index 9f8b8db28..d85c90c31 100644
--- a/libc/arch-arm/syscalls/readv.S
+++ b/libc/arch-arm/syscalls/readv.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(readv)
ldr r7, =__NR_readv
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(readv)
diff --git a/libc/arch-arm/syscalls/recvfrom.S b/libc/arch-arm/syscalls/recvfrom.S
index df6302f27..c43d2c317 100644
--- a/libc/arch-arm/syscalls/recvfrom.S
+++ b/libc/arch-arm/syscalls/recvfrom.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(recvfrom)
ldr r7, =__NR_recvfrom
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(recvfrom)
diff --git a/libc/arch-arm/syscalls/recvmsg.S b/libc/arch-arm/syscalls/recvmsg.S
index 00746a1f9..393667b5c 100644
--- a/libc/arch-arm/syscalls/recvmsg.S
+++ b/libc/arch-arm/syscalls/recvmsg.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(recvmsg)
ldr r7, =__NR_recvmsg
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(recvmsg)
diff --git a/libc/arch-arm/syscalls/removexattr.S b/libc/arch-arm/syscalls/removexattr.S
index 82fb9e088..d1e9310fa 100644
--- a/libc/arch-arm/syscalls/removexattr.S
+++ b/libc/arch-arm/syscalls/removexattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(removexattr)
ldr r7, =__NR_removexattr
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(removexattr)
diff --git a/libc/arch-arm/syscalls/rename.S b/libc/arch-arm/syscalls/rename.S
index dfe0b0ef1..6e5de6cee 100644
--- a/libc/arch-arm/syscalls/rename.S
+++ b/libc/arch-arm/syscalls/rename.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(rename)
ldr r7, =__NR_rename
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(rename)
diff --git a/libc/arch-arm/syscalls/renameat.S b/libc/arch-arm/syscalls/renameat.S
index aa42b7839..082620c54 100644
--- a/libc/arch-arm/syscalls/renameat.S
+++ b/libc/arch-arm/syscalls/renameat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(renameat)
ldr r7, =__NR_renameat
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(renameat)
diff --git a/libc/arch-arm/syscalls/rmdir.S b/libc/arch-arm/syscalls/rmdir.S
index c2d5c5adb..36277534e 100644
--- a/libc/arch-arm/syscalls/rmdir.S
+++ b/libc/arch-arm/syscalls/rmdir.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(rmdir)
ldr r7, =__NR_rmdir
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(rmdir)
diff --git a/libc/arch-arm/syscalls/sched_get_priority_max.S b/libc/arch-arm/syscalls/sched_get_priority_max.S
index 703ddeb71..d556b1b91 100644
--- a/libc/arch-arm/syscalls/sched_get_priority_max.S
+++ b/libc/arch-arm/syscalls/sched_get_priority_max.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(sched_get_priority_max)
ldr r7, =__NR_sched_get_priority_max
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sched_get_priority_max)
diff --git a/libc/arch-arm/syscalls/sched_get_priority_min.S b/libc/arch-arm/syscalls/sched_get_priority_min.S
index deea8ae01..4df227d86 100644
--- a/libc/arch-arm/syscalls/sched_get_priority_min.S
+++ b/libc/arch-arm/syscalls/sched_get_priority_min.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(sched_get_priority_min)
ldr r7, =__NR_sched_get_priority_min
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sched_get_priority_min)
diff --git a/libc/arch-arm/syscalls/sched_getparam.S b/libc/arch-arm/syscalls/sched_getparam.S
index 194d4a2a3..2c2a5bcde 100644
--- a/libc/arch-arm/syscalls/sched_getparam.S
+++ b/libc/arch-arm/syscalls/sched_getparam.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(sched_getparam)
ldr r7, =__NR_sched_getparam
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sched_getparam)
diff --git a/libc/arch-arm/syscalls/sched_getscheduler.S b/libc/arch-arm/syscalls/sched_getscheduler.S
index fd3cec588..4dcd72e15 100644
--- a/libc/arch-arm/syscalls/sched_getscheduler.S
+++ b/libc/arch-arm/syscalls/sched_getscheduler.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(sched_getscheduler)
ldr r7, =__NR_sched_getscheduler
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sched_getscheduler)
diff --git a/libc/arch-arm/syscalls/sched_rr_get_interval.S b/libc/arch-arm/syscalls/sched_rr_get_interval.S
index 21a578880..fda67f5da 100644
--- a/libc/arch-arm/syscalls/sched_rr_get_interval.S
+++ b/libc/arch-arm/syscalls/sched_rr_get_interval.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(sched_rr_get_interval)
ldr r7, =__NR_sched_rr_get_interval
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sched_rr_get_interval)
diff --git a/libc/arch-arm/syscalls/sched_setaffinity.S b/libc/arch-arm/syscalls/sched_setaffinity.S
index c980ed05b..df29a9997 100644
--- a/libc/arch-arm/syscalls/sched_setaffinity.S
+++ b/libc/arch-arm/syscalls/sched_setaffinity.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(sched_setaffinity)
ldr r7, =__NR_sched_setaffinity
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sched_setaffinity)
diff --git a/libc/arch-arm/syscalls/sched_setparam.S b/libc/arch-arm/syscalls/sched_setparam.S
index 993078d91..f6b95a0e2 100644
--- a/libc/arch-arm/syscalls/sched_setparam.S
+++ b/libc/arch-arm/syscalls/sched_setparam.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(sched_setparam)
ldr r7, =__NR_sched_setparam
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sched_setparam)
diff --git a/libc/arch-arm/syscalls/sched_setscheduler.S b/libc/arch-arm/syscalls/sched_setscheduler.S
index d0ac1dec2..0d1ab1f77 100644
--- a/libc/arch-arm/syscalls/sched_setscheduler.S
+++ b/libc/arch-arm/syscalls/sched_setscheduler.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(sched_setscheduler)
ldr r7, =__NR_sched_setscheduler
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sched_setscheduler)
diff --git a/libc/arch-arm/syscalls/sched_yield.S b/libc/arch-arm/syscalls/sched_yield.S
index 00bdfbd6a..a61deadb9 100644
--- a/libc/arch-arm/syscalls/sched_yield.S
+++ b/libc/arch-arm/syscalls/sched_yield.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(sched_yield)
ldr r7, =__NR_sched_yield
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sched_yield)
diff --git a/libc/arch-arm/syscalls/select.S b/libc/arch-arm/syscalls/select.S
index edd77a387..7b956d4d0 100644
--- a/libc/arch-arm/syscalls/select.S
+++ b/libc/arch-arm/syscalls/select.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(select)
ldr r7, =__NR__newselect
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(select)
diff --git a/libc/arch-arm/syscalls/sendfile.S b/libc/arch-arm/syscalls/sendfile.S
index 9e4c70c89..02db7f750 100644
--- a/libc/arch-arm/syscalls/sendfile.S
+++ b/libc/arch-arm/syscalls/sendfile.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(sendfile)
ldr r7, =__NR_sendfile
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sendfile)
diff --git a/libc/arch-arm/syscalls/sendmsg.S b/libc/arch-arm/syscalls/sendmsg.S
index 1b54aeebb..a269e7888 100644
--- a/libc/arch-arm/syscalls/sendmsg.S
+++ b/libc/arch-arm/syscalls/sendmsg.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(sendmsg)
ldr r7, =__NR_sendmsg
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sendmsg)
diff --git a/libc/arch-arm/syscalls/sendto.S b/libc/arch-arm/syscalls/sendto.S
index 302ba8a7e..d8afde949 100644
--- a/libc/arch-arm/syscalls/sendto.S
+++ b/libc/arch-arm/syscalls/sendto.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(sendto)
ldr r7, =__NR_sendto
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sendto)
diff --git a/libc/arch-arm/syscalls/setgid.S b/libc/arch-arm/syscalls/setgid.S
index 09045ad34..e544fd739 100644
--- a/libc/arch-arm/syscalls/setgid.S
+++ b/libc/arch-arm/syscalls/setgid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(setgid)
ldr r7, =__NR_setgid32
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(setgid)
diff --git a/libc/arch-arm/syscalls/setgroups.S b/libc/arch-arm/syscalls/setgroups.S
index e4c36b5c3..7f73d85d1 100644
--- a/libc/arch-arm/syscalls/setgroups.S
+++ b/libc/arch-arm/syscalls/setgroups.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(setgroups)
ldr r7, =__NR_setgroups32
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(setgroups)
diff --git a/libc/arch-arm/syscalls/setitimer.S b/libc/arch-arm/syscalls/setitimer.S
index dfb7a467f..7b835f7f4 100644
--- a/libc/arch-arm/syscalls/setitimer.S
+++ b/libc/arch-arm/syscalls/setitimer.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(setitimer)
ldr r7, =__NR_setitimer
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(setitimer)
diff --git a/libc/arch-arm/syscalls/setpgid.S b/libc/arch-arm/syscalls/setpgid.S
index c558063d5..2fda4fe4f 100644
--- a/libc/arch-arm/syscalls/setpgid.S
+++ b/libc/arch-arm/syscalls/setpgid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(setpgid)
ldr r7, =__NR_setpgid
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(setpgid)
diff --git a/libc/arch-arm/syscalls/setpriority.S b/libc/arch-arm/syscalls/setpriority.S
index 683da340d..fe0326b6e 100644
--- a/libc/arch-arm/syscalls/setpriority.S
+++ b/libc/arch-arm/syscalls/setpriority.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(setpriority)
ldr r7, =__NR_setpriority
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(setpriority)
diff --git a/libc/arch-arm/syscalls/setregid.S b/libc/arch-arm/syscalls/setregid.S
index 2062d05da..48745b3d1 100644
--- a/libc/arch-arm/syscalls/setregid.S
+++ b/libc/arch-arm/syscalls/setregid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(setregid)
ldr r7, =__NR_setregid32
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(setregid)
diff --git a/libc/arch-arm/syscalls/setresgid.S b/libc/arch-arm/syscalls/setresgid.S
index 089c7a74d..3e2d9fbd4 100644
--- a/libc/arch-arm/syscalls/setresgid.S
+++ b/libc/arch-arm/syscalls/setresgid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(setresgid)
ldr r7, =__NR_setresgid32
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(setresgid)
diff --git a/libc/arch-arm/syscalls/setrlimit.S b/libc/arch-arm/syscalls/setrlimit.S
index 02b8db45c..480445945 100644
--- a/libc/arch-arm/syscalls/setrlimit.S
+++ b/libc/arch-arm/syscalls/setrlimit.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(setrlimit)
ldr r7, =__NR_setrlimit
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(setrlimit)
diff --git a/libc/arch-arm/syscalls/setsid.S b/libc/arch-arm/syscalls/setsid.S
index d82c34776..f383a388c 100644
--- a/libc/arch-arm/syscalls/setsid.S
+++ b/libc/arch-arm/syscalls/setsid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(setsid)
ldr r7, =__NR_setsid
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(setsid)
diff --git a/libc/arch-arm/syscalls/setsockopt.S b/libc/arch-arm/syscalls/setsockopt.S
index 7ca91dd97..ffb99f47a 100644
--- a/libc/arch-arm/syscalls/setsockopt.S
+++ b/libc/arch-arm/syscalls/setsockopt.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(setsockopt)
ldr r7, =__NR_setsockopt
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(setsockopt)
diff --git a/libc/arch-arm/syscalls/settimeofday.S b/libc/arch-arm/syscalls/settimeofday.S
index 44f5e6635..abb2c01f9 100644
--- a/libc/arch-arm/syscalls/settimeofday.S
+++ b/libc/arch-arm/syscalls/settimeofday.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(settimeofday)
ldr r7, =__NR_settimeofday
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(settimeofday)
diff --git a/libc/arch-arm/syscalls/setxattr.S b/libc/arch-arm/syscalls/setxattr.S
index e86fe9f4d..e7422d940 100644
--- a/libc/arch-arm/syscalls/setxattr.S
+++ b/libc/arch-arm/syscalls/setxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,8 @@ ENTRY(setxattr)
ldr r7, =__NR_setxattr
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(setxattr)
diff --git a/libc/arch-arm/syscalls/shutdown.S b/libc/arch-arm/syscalls/shutdown.S
index cc96f5698..4c82ee8e8 100644
--- a/libc/arch-arm/syscalls/shutdown.S
+++ b/libc/arch-arm/syscalls/shutdown.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(shutdown)
ldr r7, =__NR_shutdown
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(shutdown)
diff --git a/libc/arch-arm/syscalls/sigaction.S b/libc/arch-arm/syscalls/sigaction.S
index 699f55d8c..e5ce66a9d 100644
--- a/libc/arch-arm/syscalls/sigaction.S
+++ b/libc/arch-arm/syscalls/sigaction.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(sigaction)
ldr r7, =__NR_sigaction
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sigaction)
diff --git a/libc/arch-arm/syscalls/sigaltstack.S b/libc/arch-arm/syscalls/sigaltstack.S
index 0f34eabc0..13d69dad0 100644
--- a/libc/arch-arm/syscalls/sigaltstack.S
+++ b/libc/arch-arm/syscalls/sigaltstack.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(sigaltstack)
ldr r7, =__NR_sigaltstack
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sigaltstack)
diff --git a/libc/arch-arm/syscalls/signalfd4.S b/libc/arch-arm/syscalls/signalfd4.S
index 6f07fbe13..c2d70caf7 100644
--- a/libc/arch-arm/syscalls/signalfd4.S
+++ b/libc/arch-arm/syscalls/signalfd4.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(signalfd4)
ldr r7, =__NR_signalfd4
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(signalfd4)
diff --git a/libc/arch-arm/syscalls/sigpending.S b/libc/arch-arm/syscalls/sigpending.S
index b5412887f..35c37c230 100644
--- a/libc/arch-arm/syscalls/sigpending.S
+++ b/libc/arch-arm/syscalls/sigpending.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(sigpending)
ldr r7, =__NR_sigpending
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sigpending)
diff --git a/libc/arch-arm/syscalls/sigprocmask.S b/libc/arch-arm/syscalls/sigprocmask.S
index d1694743c..8f8e3dcf3 100644
--- a/libc/arch-arm/syscalls/sigprocmask.S
+++ b/libc/arch-arm/syscalls/sigprocmask.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(sigprocmask)
ldr r7, =__NR_sigprocmask
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sigprocmask)
diff --git a/libc/arch-arm/syscalls/socket.S b/libc/arch-arm/syscalls/socket.S
index 1003bd4f8..560859703 100644
--- a/libc/arch-arm/syscalls/socket.S
+++ b/libc/arch-arm/syscalls/socket.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(socket)
ldr r7, =__NR_socket
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(socket)
diff --git a/libc/arch-arm/syscalls/socketpair.S b/libc/arch-arm/syscalls/socketpair.S
index 65bef6853..da40cd662 100644
--- a/libc/arch-arm/syscalls/socketpair.S
+++ b/libc/arch-arm/syscalls/socketpair.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(socketpair)
ldr r7, =__NR_socketpair
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(socketpair)
diff --git a/libc/arch-arm/syscalls/stat.S b/libc/arch-arm/syscalls/stat.S
index 17b63ccdd..0baade6ed 100644
--- a/libc/arch-arm/syscalls/stat.S
+++ b/libc/arch-arm/syscalls/stat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(stat)
ldr r7, =__NR_stat64
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(stat)
diff --git a/libc/arch-arm/syscalls/symlink.S b/libc/arch-arm/syscalls/symlink.S
index ac569afed..e72df7851 100644
--- a/libc/arch-arm/syscalls/symlink.S
+++ b/libc/arch-arm/syscalls/symlink.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(symlink)
ldr r7, =__NR_symlink
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(symlink)
diff --git a/libc/arch-arm/syscalls/sync.S b/libc/arch-arm/syscalls/sync.S
index ef6cb169b..cc8c7cdf3 100644
--- a/libc/arch-arm/syscalls/sync.S
+++ b/libc/arch-arm/syscalls/sync.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(sync)
ldr r7, =__NR_sync
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sync)
diff --git a/libc/arch-arm/syscalls/sysinfo.S b/libc/arch-arm/syscalls/sysinfo.S
index a8917354d..b02859e75 100644
--- a/libc/arch-arm/syscalls/sysinfo.S
+++ b/libc/arch-arm/syscalls/sysinfo.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(sysinfo)
ldr r7, =__NR_sysinfo
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(sysinfo)
diff --git a/libc/arch-arm/syscalls/times.S b/libc/arch-arm/syscalls/times.S
index 051f34db4..f5305c40d 100644
--- a/libc/arch-arm/syscalls/times.S
+++ b/libc/arch-arm/syscalls/times.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(times)
ldr r7, =__NR_times
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(times)
diff --git a/libc/arch-arm/syscalls/truncate.S b/libc/arch-arm/syscalls/truncate.S
index 3bb68cd06..7885be78f 100644
--- a/libc/arch-arm/syscalls/truncate.S
+++ b/libc/arch-arm/syscalls/truncate.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(truncate)
ldr r7, =__NR_truncate
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(truncate)
diff --git a/libc/arch-arm/syscalls/umask.S b/libc/arch-arm/syscalls/umask.S
index 78e43e0f2..4e5ab81cc 100644
--- a/libc/arch-arm/syscalls/umask.S
+++ b/libc/arch-arm/syscalls/umask.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(umask)
ldr r7, =__NR_umask
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(umask)
diff --git a/libc/arch-arm/syscalls/umount2.S b/libc/arch-arm/syscalls/umount2.S
index 605359e8c..ba98b98cb 100644
--- a/libc/arch-arm/syscalls/umount2.S
+++ b/libc/arch-arm/syscalls/umount2.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(umount2)
ldr r7, =__NR_umount2
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(umount2)
diff --git a/libc/arch-arm/syscalls/uname.S b/libc/arch-arm/syscalls/uname.S
index db0860b06..52736f263 100644
--- a/libc/arch-arm/syscalls/uname.S
+++ b/libc/arch-arm/syscalls/uname.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(uname)
ldr r7, =__NR_uname
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(uname)
diff --git a/libc/arch-arm/syscalls/unlink.S b/libc/arch-arm/syscalls/unlink.S
index 8ef33dfd2..2fb111b46 100644
--- a/libc/arch-arm/syscalls/unlink.S
+++ b/libc/arch-arm/syscalls/unlink.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(unlink)
ldr r7, =__NR_unlink
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(unlink)
diff --git a/libc/arch-arm/syscalls/unlinkat.S b/libc/arch-arm/syscalls/unlinkat.S
index eb822e49a..888e89342 100644
--- a/libc/arch-arm/syscalls/unlinkat.S
+++ b/libc/arch-arm/syscalls/unlinkat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(unlinkat)
ldr r7, =__NR_unlinkat
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(unlinkat)
diff --git a/libc/arch-arm/syscalls/unshare.S b/libc/arch-arm/syscalls/unshare.S
index ec77f3ad9..682c77ab7 100644
--- a/libc/arch-arm/syscalls/unshare.S
+++ b/libc/arch-arm/syscalls/unshare.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(unshare)
ldr r7, =__NR_unshare
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(unshare)
diff --git a/libc/arch-arm/syscalls/utimensat.S b/libc/arch-arm/syscalls/utimensat.S
index 976a667a3..cc2266a00 100644
--- a/libc/arch-arm/syscalls/utimensat.S
+++ b/libc/arch-arm/syscalls/utimensat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(utimensat)
ldr r7, =__NR_utimensat
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(utimensat)
diff --git a/libc/arch-arm/syscalls/utimes.S b/libc/arch-arm/syscalls/utimes.S
index 8966626f5..436012548 100644
--- a/libc/arch-arm/syscalls/utimes.S
+++ b/libc/arch-arm/syscalls/utimes.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(utimes)
ldr r7, =__NR_utimes
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(utimes)
diff --git a/libc/arch-arm/syscalls/vfork.S b/libc/arch-arm/syscalls/vfork.S
index 89cbda2ca..23367f597 100644
--- a/libc/arch-arm/syscalls/vfork.S
+++ b/libc/arch-arm/syscalls/vfork.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(vfork)
ldr r7, =__NR_vfork
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(vfork)
diff --git a/libc/arch-arm/syscalls/write.S b/libc/arch-arm/syscalls/write.S
index c25791585..974e28b4e 100644
--- a/libc/arch-arm/syscalls/write.S
+++ b/libc/arch-arm/syscalls/write.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(write)
ldr r7, =__NR_write
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(write)
diff --git a/libc/arch-arm/syscalls/writev.S b/libc/arch-arm/syscalls/writev.S
index 521e10cda..d52fc1b02 100644
--- a/libc/arch-arm/syscalls/writev.S
+++ b/libc/arch-arm/syscalls/writev.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,8 @@ ENTRY(writev)
ldr r7, =__NR_writev
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(writev)
diff --git a/libc/arch-x86/syscalls/__brk.S b/libc/arch-x86/syscalls/__brk.S
index f7a81fff4..88841df61 100644
--- a/libc/arch-x86/syscalls/__brk.S
+++ b/libc/arch-x86/syscalls/__brk.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(__brk)
mov 8(%esp), %ebx
movl $__NR_brk, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__fcntl.S b/libc/arch-x86/syscalls/__fcntl.S
index 9f74d8669..087097e42 100644
--- a/libc/arch-x86/syscalls/__fcntl.S
+++ b/libc/arch-x86/syscalls/__fcntl.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(__fcntl)
mov 24(%esp), %edx
movl $__NR_fcntl, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__fcntl64.S b/libc/arch-x86/syscalls/__fcntl64.S
index c59f4902e..5a67ee161 100644
--- a/libc/arch-x86/syscalls/__fcntl64.S
+++ b/libc/arch-x86/syscalls/__fcntl64.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(__fcntl64)
mov 24(%esp), %edx
movl $__NR_fcntl64, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__fork.S b/libc/arch-x86/syscalls/__fork.S
index 557714d16..7c3661de7 100644
--- a/libc/arch-x86/syscalls/__fork.S
+++ b/libc/arch-x86/syscalls/__fork.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(__fork)
mov 8(%esp), %ebx
movl $__NR_fork, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__fstatfs64.S b/libc/arch-x86/syscalls/__fstatfs64.S
index 9943362c8..57eb2f63e 100644
--- a/libc/arch-x86/syscalls/__fstatfs64.S
+++ b/libc/arch-x86/syscalls/__fstatfs64.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(__fstatfs64)
mov 24(%esp), %edx
movl $__NR_fstatfs64, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__getcpu.S b/libc/arch-x86/syscalls/__getcpu.S
index 152f5c88e..448e0121a 100644
--- a/libc/arch-x86/syscalls/__getcpu.S
+++ b/libc/arch-x86/syscalls/__getcpu.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(__getcpu)
mov 24(%esp), %edx
movl $__NR_getcpu, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__getcwd.S b/libc/arch-x86/syscalls/__getcwd.S
index 2e30d9b4f..29a73e38c 100644
--- a/libc/arch-x86/syscalls/__getcwd.S
+++ b/libc/arch-x86/syscalls/__getcwd.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(__getcwd)
mov 16(%esp), %ecx
movl $__NR_getcwd, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__getpriority.S b/libc/arch-x86/syscalls/__getpriority.S
index a01512793..c5f47514b 100644
--- a/libc/arch-x86/syscalls/__getpriority.S
+++ b/libc/arch-x86/syscalls/__getpriority.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(__getpriority)
mov 16(%esp), %ecx
movl $__NR_getpriority, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__ioctl.S b/libc/arch-x86/syscalls/__ioctl.S
index db85a196b..e64c3af48 100644
--- a/libc/arch-x86/syscalls/__ioctl.S
+++ b/libc/arch-x86/syscalls/__ioctl.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(__ioctl)
mov 24(%esp), %edx
movl $__NR_ioctl, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__llseek.S b/libc/arch-x86/syscalls/__llseek.S
index 7811f6ba4..9160ee71e 100644
--- a/libc/arch-x86/syscalls/__llseek.S
+++ b/libc/arch-x86/syscalls/__llseek.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -15,7 +16,7 @@ ENTRY(__llseek)
mov 40(%esp), %edi
movl $__NR__llseek, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__mmap2.S b/libc/arch-x86/syscalls/__mmap2.S
index 535a891ee..59c6d231b 100644
--- a/libc/arch-x86/syscalls/__mmap2.S
+++ b/libc/arch-x86/syscalls/__mmap2.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -17,7 +18,7 @@ ENTRY(__mmap2)
mov 48(%esp), %ebp
movl $__NR_mmap2, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__open.S b/libc/arch-x86/syscalls/__open.S
index b87823113..02b99b7b7 100644
--- a/libc/arch-x86/syscalls/__open.S
+++ b/libc/arch-x86/syscalls/__open.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(__open)
mov 24(%esp), %edx
movl $__NR_open, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__openat.S b/libc/arch-x86/syscalls/__openat.S
index faf8013d9..8a7dafe20 100644
--- a/libc/arch-x86/syscalls/__openat.S
+++ b/libc/arch-x86/syscalls/__openat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(__openat)
mov 32(%esp), %esi
movl $__NR_openat, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__ptrace.S b/libc/arch-x86/syscalls/__ptrace.S
index f574cf0d8..157bdd8b7 100644
--- a/libc/arch-x86/syscalls/__ptrace.S
+++ b/libc/arch-x86/syscalls/__ptrace.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(__ptrace)
mov 32(%esp), %esi
movl $__NR_ptrace, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__reboot.S b/libc/arch-x86/syscalls/__reboot.S
index 626a95576..6c6ecff4b 100644
--- a/libc/arch-x86/syscalls/__reboot.S
+++ b/libc/arch-x86/syscalls/__reboot.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(__reboot)
mov 32(%esp), %esi
movl $__NR_reboot, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__rt_sigaction.S b/libc/arch-x86/syscalls/__rt_sigaction.S
index ef9893b47..b0ffaeee1 100644
--- a/libc/arch-x86/syscalls/__rt_sigaction.S
+++ b/libc/arch-x86/syscalls/__rt_sigaction.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(__rt_sigaction)
mov 32(%esp), %esi
movl $__NR_rt_sigaction, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__rt_sigprocmask.S b/libc/arch-x86/syscalls/__rt_sigprocmask.S
index 930c9b27a..26b2fee89 100644
--- a/libc/arch-x86/syscalls/__rt_sigprocmask.S
+++ b/libc/arch-x86/syscalls/__rt_sigprocmask.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(__rt_sigprocmask)
mov 32(%esp), %esi
movl $__NR_rt_sigprocmask, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__rt_sigtimedwait.S b/libc/arch-x86/syscalls/__rt_sigtimedwait.S
index ba867f57f..af53f0401 100644
--- a/libc/arch-x86/syscalls/__rt_sigtimedwait.S
+++ b/libc/arch-x86/syscalls/__rt_sigtimedwait.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(__rt_sigtimedwait)
mov 32(%esp), %esi
movl $__NR_rt_sigtimedwait, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__sched_getaffinity.S b/libc/arch-x86/syscalls/__sched_getaffinity.S
index 2a40b6513..21efaee33 100644
--- a/libc/arch-x86/syscalls/__sched_getaffinity.S
+++ b/libc/arch-x86/syscalls/__sched_getaffinity.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(__sched_getaffinity)
mov 24(%esp), %edx
movl $__NR_sched_getaffinity, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__set_thread_area.S b/libc/arch-x86/syscalls/__set_thread_area.S
index dc4a561b9..bcdbca398 100644
--- a/libc/arch-x86/syscalls/__set_thread_area.S
+++ b/libc/arch-x86/syscalls/__set_thread_area.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(__set_thread_area)
mov 8(%esp), %ebx
movl $__NR_set_thread_area, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__setresuid.S b/libc/arch-x86/syscalls/__setresuid.S
index c604984b1..d23504242 100644
--- a/libc/arch-x86/syscalls/__setresuid.S
+++ b/libc/arch-x86/syscalls/__setresuid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(__setresuid)
mov 24(%esp), %edx
movl $__NR_setresuid32, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__setreuid.S b/libc/arch-x86/syscalls/__setreuid.S
index 581873976..61eea656d 100644
--- a/libc/arch-x86/syscalls/__setreuid.S
+++ b/libc/arch-x86/syscalls/__setreuid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(__setreuid)
mov 16(%esp), %ecx
movl $__NR_setreuid32, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__setuid.S b/libc/arch-x86/syscalls/__setuid.S
index df578b86c..f5b5c720c 100644
--- a/libc/arch-x86/syscalls/__setuid.S
+++ b/libc/arch-x86/syscalls/__setuid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(__setuid)
mov 8(%esp), %ebx
movl $__NR_setuid32, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__sigsuspend.S b/libc/arch-x86/syscalls/__sigsuspend.S
index b09f8727c..52bb2d8cb 100644
--- a/libc/arch-x86/syscalls/__sigsuspend.S
+++ b/libc/arch-x86/syscalls/__sigsuspend.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(__sigsuspend)
mov 24(%esp), %edx
movl $__NR_sigsuspend, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__statfs64.S b/libc/arch-x86/syscalls/__statfs64.S
index 4f46bd7b1..3716cec69 100644
--- a/libc/arch-x86/syscalls/__statfs64.S
+++ b/libc/arch-x86/syscalls/__statfs64.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(__statfs64)
mov 24(%esp), %edx
movl $__NR_statfs64, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__sys_clone.S b/libc/arch-x86/syscalls/__sys_clone.S
index a5ce1706e..674797bde 100644
--- a/libc/arch-x86/syscalls/__sys_clone.S
+++ b/libc/arch-x86/syscalls/__sys_clone.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -15,7 +16,7 @@ ENTRY(__sys_clone)
mov 40(%esp), %edi
movl $__NR_clone, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__syslog.S b/libc/arch-x86/syscalls/__syslog.S
index 9d3677985..8db151a19 100644
--- a/libc/arch-x86/syscalls/__syslog.S
+++ b/libc/arch-x86/syscalls/__syslog.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(__syslog)
mov 24(%esp), %edx
movl $__NR_syslog, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__timer_create.S b/libc/arch-x86/syscalls/__timer_create.S
index b319f1b7e..5b927062c 100644
--- a/libc/arch-x86/syscalls/__timer_create.S
+++ b/libc/arch-x86/syscalls/__timer_create.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(__timer_create)
mov 24(%esp), %edx
movl $__NR_timer_create, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__timer_delete.S b/libc/arch-x86/syscalls/__timer_delete.S
index 7fb5930f7..3ba48e458 100644
--- a/libc/arch-x86/syscalls/__timer_delete.S
+++ b/libc/arch-x86/syscalls/__timer_delete.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(__timer_delete)
mov 8(%esp), %ebx
movl $__NR_timer_delete, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__timer_getoverrun.S b/libc/arch-x86/syscalls/__timer_getoverrun.S
index 477a3d8d2..f49e218d6 100644
--- a/libc/arch-x86/syscalls/__timer_getoverrun.S
+++ b/libc/arch-x86/syscalls/__timer_getoverrun.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(__timer_getoverrun)
mov 8(%esp), %ebx
movl $__NR_timer_getoverrun, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__timer_gettime.S b/libc/arch-x86/syscalls/__timer_gettime.S
index ee5604df7..b1dd22c38 100644
--- a/libc/arch-x86/syscalls/__timer_gettime.S
+++ b/libc/arch-x86/syscalls/__timer_gettime.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(__timer_gettime)
mov 16(%esp), %ecx
movl $__NR_timer_gettime, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__timer_settime.S b/libc/arch-x86/syscalls/__timer_settime.S
index 9758f6153..9bda7f8ba 100644
--- a/libc/arch-x86/syscalls/__timer_settime.S
+++ b/libc/arch-x86/syscalls/__timer_settime.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(__timer_settime)
mov 32(%esp), %esi
movl $__NR_timer_settime, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__wait4.S b/libc/arch-x86/syscalls/__wait4.S
index 23165a39b..57de4d9f7 100644
--- a/libc/arch-x86/syscalls/__wait4.S
+++ b/libc/arch-x86/syscalls/__wait4.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(__wait4)
mov 32(%esp), %esi
movl $__NR_wait4, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/__waitid.S b/libc/arch-x86/syscalls/__waitid.S
index 12f1ac878..9c2125af3 100644
--- a/libc/arch-x86/syscalls/__waitid.S
+++ b/libc/arch-x86/syscalls/__waitid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -15,7 +16,7 @@ ENTRY(__waitid)
mov 40(%esp), %edi
movl $__NR_waitid, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/_exit.S b/libc/arch-x86/syscalls/_exit.S
index e17f925d6..0bfb2f93a 100644
--- a/libc/arch-x86/syscalls/_exit.S
+++ b/libc/arch-x86/syscalls/_exit.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(_exit)
mov 8(%esp), %ebx
movl $__NR_exit_group, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/_exit_thread.S b/libc/arch-x86/syscalls/_exit_thread.S
index a371350a3..d20caea7b 100644
--- a/libc/arch-x86/syscalls/_exit_thread.S
+++ b/libc/arch-x86/syscalls/_exit_thread.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(_exit_thread)
mov 8(%esp), %ebx
movl $__NR_exit, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/_waitpid.S b/libc/arch-x86/syscalls/_waitpid.S
index 59bf20e59..74da41ab3 100644
--- a/libc/arch-x86/syscalls/_waitpid.S
+++ b/libc/arch-x86/syscalls/_waitpid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(_waitpid)
mov 32(%esp), %esi
movl $__NR_waitpid, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/accept.S b/libc/arch-x86/syscalls/accept.S
index f5fcb5d22..5c0df0ddb 100644
--- a/libc/arch-x86/syscalls/accept.S
+++ b/libc/arch-x86/syscalls/accept.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,7 @@ ENTRY(accept)
addl $12, %ecx
movl $__NR_socketcall, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/access.S b/libc/arch-x86/syscalls/access.S
index 0f68574d3..cdf2a2a68 100644
--- a/libc/arch-x86/syscalls/access.S
+++ b/libc/arch-x86/syscalls/access.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(access)
mov 16(%esp), %ecx
movl $__NR_access, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/acct.S b/libc/arch-x86/syscalls/acct.S
index bf991d62b..0d224ee93 100644
--- a/libc/arch-x86/syscalls/acct.S
+++ b/libc/arch-x86/syscalls/acct.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(acct)
mov 8(%esp), %ebx
movl $__NR_acct, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/bind.S b/libc/arch-x86/syscalls/bind.S
index ff6ae9f0d..942aba59a 100644
--- a/libc/arch-x86/syscalls/bind.S
+++ b/libc/arch-x86/syscalls/bind.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,7 @@ ENTRY(bind)
addl $12, %ecx
movl $__NR_socketcall, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/capget.S b/libc/arch-x86/syscalls/capget.S
index 55960f170..55d230cc6 100644
--- a/libc/arch-x86/syscalls/capget.S
+++ b/libc/arch-x86/syscalls/capget.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(capget)
mov 16(%esp), %ecx
movl $__NR_capget, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/capset.S b/libc/arch-x86/syscalls/capset.S
index c8703c76a..5ce72e4a0 100644
--- a/libc/arch-x86/syscalls/capset.S
+++ b/libc/arch-x86/syscalls/capset.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(capset)
mov 16(%esp), %ecx
movl $__NR_capset, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/chdir.S b/libc/arch-x86/syscalls/chdir.S
index d40d099f3..f453d94c3 100644
--- a/libc/arch-x86/syscalls/chdir.S
+++ b/libc/arch-x86/syscalls/chdir.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(chdir)
mov 8(%esp), %ebx
movl $__NR_chdir, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/chmod.S b/libc/arch-x86/syscalls/chmod.S
index 307e19627..3202cbdee 100644
--- a/libc/arch-x86/syscalls/chmod.S
+++ b/libc/arch-x86/syscalls/chmod.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(chmod)
mov 16(%esp), %ecx
movl $__NR_chmod, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/chown.S b/libc/arch-x86/syscalls/chown.S
index 800bf0441..df3f259fc 100644
--- a/libc/arch-x86/syscalls/chown.S
+++ b/libc/arch-x86/syscalls/chown.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(chown)
mov 24(%esp), %edx
movl $__NR_chown32, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/chroot.S b/libc/arch-x86/syscalls/chroot.S
index 24d2d109c..35a37a9bc 100644
--- a/libc/arch-x86/syscalls/chroot.S
+++ b/libc/arch-x86/syscalls/chroot.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(chroot)
mov 8(%esp), %ebx
movl $__NR_chroot, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/clock_getres.S b/libc/arch-x86/syscalls/clock_getres.S
index da332aa34..543887b9c 100644
--- a/libc/arch-x86/syscalls/clock_getres.S
+++ b/libc/arch-x86/syscalls/clock_getres.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(clock_getres)
mov 16(%esp), %ecx
movl $__NR_clock_getres, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/clock_gettime.S b/libc/arch-x86/syscalls/clock_gettime.S
index 41ac5e219..38a8ec9fb 100644
--- a/libc/arch-x86/syscalls/clock_gettime.S
+++ b/libc/arch-x86/syscalls/clock_gettime.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(clock_gettime)
mov 16(%esp), %ecx
movl $__NR_clock_gettime, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/clock_nanosleep.S b/libc/arch-x86/syscalls/clock_nanosleep.S
index cd163dfe1..94f7c39b1 100644
--- a/libc/arch-x86/syscalls/clock_nanosleep.S
+++ b/libc/arch-x86/syscalls/clock_nanosleep.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(clock_nanosleep)
mov 32(%esp), %esi
movl $__NR_clock_nanosleep, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/clock_settime.S b/libc/arch-x86/syscalls/clock_settime.S
index 18237c4c7..f82aa7840 100644
--- a/libc/arch-x86/syscalls/clock_settime.S
+++ b/libc/arch-x86/syscalls/clock_settime.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(clock_settime)
mov 16(%esp), %ecx
movl $__NR_clock_settime, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/close.S b/libc/arch-x86/syscalls/close.S
index 76175c79e..b9c7961d4 100644
--- a/libc/arch-x86/syscalls/close.S
+++ b/libc/arch-x86/syscalls/close.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(close)
mov 8(%esp), %ebx
movl $__NR_close, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/connect.S b/libc/arch-x86/syscalls/connect.S
index e87b12377..3298e08a2 100644
--- a/libc/arch-x86/syscalls/connect.S
+++ b/libc/arch-x86/syscalls/connect.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,7 @@ ENTRY(connect)
addl $12, %ecx
movl $__NR_socketcall, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/delete_module.S b/libc/arch-x86/syscalls/delete_module.S
index 10a06a38a..92b644653 100644
--- a/libc/arch-x86/syscalls/delete_module.S
+++ b/libc/arch-x86/syscalls/delete_module.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(delete_module)
mov 16(%esp), %ecx
movl $__NR_delete_module, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/dup.S b/libc/arch-x86/syscalls/dup.S
index 80259fe81..b3de1fb0d 100644
--- a/libc/arch-x86/syscalls/dup.S
+++ b/libc/arch-x86/syscalls/dup.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(dup)
mov 8(%esp), %ebx
movl $__NR_dup, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/dup2.S b/libc/arch-x86/syscalls/dup2.S
index 43def66d2..7558f567c 100644
--- a/libc/arch-x86/syscalls/dup2.S
+++ b/libc/arch-x86/syscalls/dup2.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(dup2)
mov 16(%esp), %ecx
movl $__NR_dup2, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/epoll_create.S b/libc/arch-x86/syscalls/epoll_create.S
index 0bdc8857a..010473a92 100644
--- a/libc/arch-x86/syscalls/epoll_create.S
+++ b/libc/arch-x86/syscalls/epoll_create.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(epoll_create)
mov 8(%esp), %ebx
movl $__NR_epoll_create, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/epoll_ctl.S b/libc/arch-x86/syscalls/epoll_ctl.S
index 43175d2ee..4a879000c 100644
--- a/libc/arch-x86/syscalls/epoll_ctl.S
+++ b/libc/arch-x86/syscalls/epoll_ctl.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(epoll_ctl)
mov 32(%esp), %esi
movl $__NR_epoll_ctl, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/epoll_wait.S b/libc/arch-x86/syscalls/epoll_wait.S
index e2d61c05c..616f73500 100644
--- a/libc/arch-x86/syscalls/epoll_wait.S
+++ b/libc/arch-x86/syscalls/epoll_wait.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(epoll_wait)
mov 32(%esp), %esi
movl $__NR_epoll_wait, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/eventfd.S b/libc/arch-x86/syscalls/eventfd.S
index 338696f5a..4ad4cea6d 100644
--- a/libc/arch-x86/syscalls/eventfd.S
+++ b/libc/arch-x86/syscalls/eventfd.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(eventfd)
mov 16(%esp), %ecx
movl $__NR_eventfd2, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/execve.S b/libc/arch-x86/syscalls/execve.S
index c7e3ca5fa..82922a3b7 100644
--- a/libc/arch-x86/syscalls/execve.S
+++ b/libc/arch-x86/syscalls/execve.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(execve)
mov 24(%esp), %edx
movl $__NR_execve, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/faccessat.S b/libc/arch-x86/syscalls/faccessat.S
index 673302944..275626521 100644
--- a/libc/arch-x86/syscalls/faccessat.S
+++ b/libc/arch-x86/syscalls/faccessat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(faccessat)
mov 32(%esp), %esi
movl $__NR_faccessat, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/fchdir.S b/libc/arch-x86/syscalls/fchdir.S
index 23aa6e23a..9badf6f21 100644
--- a/libc/arch-x86/syscalls/fchdir.S
+++ b/libc/arch-x86/syscalls/fchdir.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(fchdir)
mov 8(%esp), %ebx
movl $__NR_fchdir, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/fchmod.S b/libc/arch-x86/syscalls/fchmod.S
index 019eb07cd..4cf79cc3c 100644
--- a/libc/arch-x86/syscalls/fchmod.S
+++ b/libc/arch-x86/syscalls/fchmod.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(fchmod)
mov 16(%esp), %ecx
movl $__NR_fchmod, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/fchmodat.S b/libc/arch-x86/syscalls/fchmodat.S
index f7292f9be..b91fdf7c8 100644
--- a/libc/arch-x86/syscalls/fchmodat.S
+++ b/libc/arch-x86/syscalls/fchmodat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(fchmodat)
mov 32(%esp), %esi
movl $__NR_fchmodat, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/fchown.S b/libc/arch-x86/syscalls/fchown.S
index f17c0d6a0..f5f684998 100644
--- a/libc/arch-x86/syscalls/fchown.S
+++ b/libc/arch-x86/syscalls/fchown.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(fchown)
mov 24(%esp), %edx
movl $__NR_fchown32, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/fchownat.S b/libc/arch-x86/syscalls/fchownat.S
index 7648d7940..183ae1def 100644
--- a/libc/arch-x86/syscalls/fchownat.S
+++ b/libc/arch-x86/syscalls/fchownat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -15,7 +16,7 @@ ENTRY(fchownat)
mov 40(%esp), %edi
movl $__NR_fchownat, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/fdatasync.S b/libc/arch-x86/syscalls/fdatasync.S
index 2808e0fee..73811a5be 100644
--- a/libc/arch-x86/syscalls/fdatasync.S
+++ b/libc/arch-x86/syscalls/fdatasync.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(fdatasync)
mov 8(%esp), %ebx
movl $__NR_fdatasync, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/fgetxattr.S b/libc/arch-x86/syscalls/fgetxattr.S
index beaab097b..dc6c45772 100644
--- a/libc/arch-x86/syscalls/fgetxattr.S
+++ b/libc/arch-x86/syscalls/fgetxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(fgetxattr)
mov 32(%esp), %esi
movl $__NR_fgetxattr, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/flistxattr.S b/libc/arch-x86/syscalls/flistxattr.S
index 95935c0f2..bcef232e7 100644
--- a/libc/arch-x86/syscalls/flistxattr.S
+++ b/libc/arch-x86/syscalls/flistxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(flistxattr)
mov 24(%esp), %edx
movl $__NR_flistxattr, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/flock.S b/libc/arch-x86/syscalls/flock.S
index 156844c00..e73f1b646 100644
--- a/libc/arch-x86/syscalls/flock.S
+++ b/libc/arch-x86/syscalls/flock.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(flock)
mov 16(%esp), %ecx
movl $__NR_flock, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/fremovexattr.S b/libc/arch-x86/syscalls/fremovexattr.S
index 32d0bdc47..0535938ad 100644
--- a/libc/arch-x86/syscalls/fremovexattr.S
+++ b/libc/arch-x86/syscalls/fremovexattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(fremovexattr)
mov 16(%esp), %ecx
movl $__NR_fremovexattr, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/fsetxattr.S b/libc/arch-x86/syscalls/fsetxattr.S
index c3d588e85..3a88be80d 100644
--- a/libc/arch-x86/syscalls/fsetxattr.S
+++ b/libc/arch-x86/syscalls/fsetxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -15,7 +16,7 @@ ENTRY(fsetxattr)
mov 40(%esp), %edi
movl $__NR_fsetxattr, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/fstat.S b/libc/arch-x86/syscalls/fstat.S
index 95301d956..4969b009b 100644
--- a/libc/arch-x86/syscalls/fstat.S
+++ b/libc/arch-x86/syscalls/fstat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(fstat)
mov 16(%esp), %ecx
movl $__NR_fstat64, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/fstatat.S b/libc/arch-x86/syscalls/fstatat.S
index 947f4dac1..0bae34f96 100644
--- a/libc/arch-x86/syscalls/fstatat.S
+++ b/libc/arch-x86/syscalls/fstatat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(fstatat)
mov 32(%esp), %esi
movl $__NR_fstatat64, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/fsync.S b/libc/arch-x86/syscalls/fsync.S
index 363b334a1..6cf6ee837 100644
--- a/libc/arch-x86/syscalls/fsync.S
+++ b/libc/arch-x86/syscalls/fsync.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(fsync)
mov 8(%esp), %ebx
movl $__NR_fsync, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/ftruncate.S b/libc/arch-x86/syscalls/ftruncate.S
index 1ed3f96f9..ff3e9451b 100644
--- a/libc/arch-x86/syscalls/ftruncate.S
+++ b/libc/arch-x86/syscalls/ftruncate.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(ftruncate)
mov 16(%esp), %ecx
movl $__NR_ftruncate, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/ftruncate64.S b/libc/arch-x86/syscalls/ftruncate64.S
index fa6dbef8d..fe23a4111 100644
--- a/libc/arch-x86/syscalls/ftruncate64.S
+++ b/libc/arch-x86/syscalls/ftruncate64.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(ftruncate64)
mov 24(%esp), %edx
movl $__NR_ftruncate64, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/futex.S b/libc/arch-x86/syscalls/futex.S
index f72be1b39..b21da36e4 100644
--- a/libc/arch-x86/syscalls/futex.S
+++ b/libc/arch-x86/syscalls/futex.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -17,7 +18,7 @@ ENTRY(futex)
mov 48(%esp), %ebp
movl $__NR_futex, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getdents.S b/libc/arch-x86/syscalls/getdents.S
index c5d2721be..baef2338f 100644
--- a/libc/arch-x86/syscalls/getdents.S
+++ b/libc/arch-x86/syscalls/getdents.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(getdents)
mov 24(%esp), %edx
movl $__NR_getdents64, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getegid.S b/libc/arch-x86/syscalls/getegid.S
index c26ebc251..4dc0678f2 100644
--- a/libc/arch-x86/syscalls/getegid.S
+++ b/libc/arch-x86/syscalls/getegid.S
@@ -1,11 +1,12 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(getegid)
movl $__NR_getegid32, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/geteuid.S b/libc/arch-x86/syscalls/geteuid.S
index a7761e80a..a2c402974 100644
--- a/libc/arch-x86/syscalls/geteuid.S
+++ b/libc/arch-x86/syscalls/geteuid.S
@@ -1,11 +1,12 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(geteuid)
movl $__NR_geteuid32, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getgid.S b/libc/arch-x86/syscalls/getgid.S
index 7a5120002..8885cf906 100644
--- a/libc/arch-x86/syscalls/getgid.S
+++ b/libc/arch-x86/syscalls/getgid.S
@@ -1,11 +1,12 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(getgid)
movl $__NR_getgid32, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getgroups.S b/libc/arch-x86/syscalls/getgroups.S
index 35bc3f589..3e580e370 100644
--- a/libc/arch-x86/syscalls/getgroups.S
+++ b/libc/arch-x86/syscalls/getgroups.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(getgroups)
mov 16(%esp), %ecx
movl $__NR_getgroups32, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getitimer.S b/libc/arch-x86/syscalls/getitimer.S
index 79957dad6..40e984b07 100644
--- a/libc/arch-x86/syscalls/getitimer.S
+++ b/libc/arch-x86/syscalls/getitimer.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(getitimer)
mov 16(%esp), %ecx
movl $__NR_getitimer, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getpeername.S b/libc/arch-x86/syscalls/getpeername.S
index 383199034..854cf9fd9 100644
--- a/libc/arch-x86/syscalls/getpeername.S
+++ b/libc/arch-x86/syscalls/getpeername.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,7 @@ ENTRY(getpeername)
addl $12, %ecx
movl $__NR_socketcall, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getpgid.S b/libc/arch-x86/syscalls/getpgid.S
index f49abbf70..990af5835 100644
--- a/libc/arch-x86/syscalls/getpgid.S
+++ b/libc/arch-x86/syscalls/getpgid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(getpgid)
mov 8(%esp), %ebx
movl $__NR_getpgid, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getpid.S b/libc/arch-x86/syscalls/getpid.S
index 29703e86e..3f4406e34 100644
--- a/libc/arch-x86/syscalls/getpid.S
+++ b/libc/arch-x86/syscalls/getpid.S
@@ -1,11 +1,12 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(getpid)
movl $__NR_getpid, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getppid.S b/libc/arch-x86/syscalls/getppid.S
index dc89d6e3e..f1f3f6bca 100644
--- a/libc/arch-x86/syscalls/getppid.S
+++ b/libc/arch-x86/syscalls/getppid.S
@@ -1,11 +1,12 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(getppid)
movl $__NR_getppid, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getresgid.S b/libc/arch-x86/syscalls/getresgid.S
index 08a37e7ac..bac8f594e 100644
--- a/libc/arch-x86/syscalls/getresgid.S
+++ b/libc/arch-x86/syscalls/getresgid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(getresgid)
mov 24(%esp), %edx
movl $__NR_getresgid32, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getresuid.S b/libc/arch-x86/syscalls/getresuid.S
index 435a901c7..e78c83557 100644
--- a/libc/arch-x86/syscalls/getresuid.S
+++ b/libc/arch-x86/syscalls/getresuid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(getresuid)
mov 24(%esp), %edx
movl $__NR_getresuid32, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getrlimit.S b/libc/arch-x86/syscalls/getrlimit.S
index 8f6edd6fc..4c3e56e85 100644
--- a/libc/arch-x86/syscalls/getrlimit.S
+++ b/libc/arch-x86/syscalls/getrlimit.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(getrlimit)
mov 16(%esp), %ecx
movl $__NR_ugetrlimit, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getrusage.S b/libc/arch-x86/syscalls/getrusage.S
index ee47f3d65..90d58ba72 100644
--- a/libc/arch-x86/syscalls/getrusage.S
+++ b/libc/arch-x86/syscalls/getrusage.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(getrusage)
mov 16(%esp), %ecx
movl $__NR_getrusage, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getsid.S b/libc/arch-x86/syscalls/getsid.S
index 876bf6a33..4cb81822f 100644
--- a/libc/arch-x86/syscalls/getsid.S
+++ b/libc/arch-x86/syscalls/getsid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(getsid)
mov 8(%esp), %ebx
movl $__NR_getsid, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getsockname.S b/libc/arch-x86/syscalls/getsockname.S
index b28ecb871..931bf79fd 100644
--- a/libc/arch-x86/syscalls/getsockname.S
+++ b/libc/arch-x86/syscalls/getsockname.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,7 @@ ENTRY(getsockname)
addl $12, %ecx
movl $__NR_socketcall, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getsockopt.S b/libc/arch-x86/syscalls/getsockopt.S
index 190b6f293..ffd4730e5 100644
--- a/libc/arch-x86/syscalls/getsockopt.S
+++ b/libc/arch-x86/syscalls/getsockopt.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,7 @@ ENTRY(getsockopt)
addl $12, %ecx
movl $__NR_socketcall, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/gettid.S b/libc/arch-x86/syscalls/gettid.S
index c1e6ba048..5e6d65e1b 100644
--- a/libc/arch-x86/syscalls/gettid.S
+++ b/libc/arch-x86/syscalls/gettid.S
@@ -1,11 +1,12 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(gettid)
movl $__NR_gettid, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/gettimeofday.S b/libc/arch-x86/syscalls/gettimeofday.S
index 34b998273..142faa353 100644
--- a/libc/arch-x86/syscalls/gettimeofday.S
+++ b/libc/arch-x86/syscalls/gettimeofday.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(gettimeofday)
mov 16(%esp), %ecx
movl $__NR_gettimeofday, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getuid.S b/libc/arch-x86/syscalls/getuid.S
index e82b8b011..9aa8bc6ac 100644
--- a/libc/arch-x86/syscalls/getuid.S
+++ b/libc/arch-x86/syscalls/getuid.S
@@ -1,11 +1,12 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(getuid)
movl $__NR_getuid32, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/getxattr.S b/libc/arch-x86/syscalls/getxattr.S
index 92f7c30e4..e3d9edcc5 100644
--- a/libc/arch-x86/syscalls/getxattr.S
+++ b/libc/arch-x86/syscalls/getxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(getxattr)
mov 32(%esp), %esi
movl $__NR_getxattr, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/init_module.S b/libc/arch-x86/syscalls/init_module.S
index 3ef9b365d..74ebfe879 100644
--- a/libc/arch-x86/syscalls/init_module.S
+++ b/libc/arch-x86/syscalls/init_module.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(init_module)
mov 24(%esp), %edx
movl $__NR_init_module, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/inotify_add_watch.S b/libc/arch-x86/syscalls/inotify_add_watch.S
index 7b57f3cf2..58a6fd4b5 100644
--- a/libc/arch-x86/syscalls/inotify_add_watch.S
+++ b/libc/arch-x86/syscalls/inotify_add_watch.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(inotify_add_watch)
mov 24(%esp), %edx
movl $__NR_inotify_add_watch, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/inotify_init.S b/libc/arch-x86/syscalls/inotify_init.S
index c19174b85..66b3a6545 100644
--- a/libc/arch-x86/syscalls/inotify_init.S
+++ b/libc/arch-x86/syscalls/inotify_init.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(inotify_init)
mov 8(%esp), %ebx
movl $__NR_inotify_init, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/inotify_rm_watch.S b/libc/arch-x86/syscalls/inotify_rm_watch.S
index 351bdc2cb..4db579997 100644
--- a/libc/arch-x86/syscalls/inotify_rm_watch.S
+++ b/libc/arch-x86/syscalls/inotify_rm_watch.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(inotify_rm_watch)
mov 16(%esp), %ecx
movl $__NR_inotify_rm_watch, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/ioprio_get.S b/libc/arch-x86/syscalls/ioprio_get.S
index b64662f1c..7c6daa360 100644
--- a/libc/arch-x86/syscalls/ioprio_get.S
+++ b/libc/arch-x86/syscalls/ioprio_get.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(ioprio_get)
mov 16(%esp), %ecx
movl $__NR_ioprio_get, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/ioprio_set.S b/libc/arch-x86/syscalls/ioprio_set.S
index 6f2a4f320..4be460e33 100644
--- a/libc/arch-x86/syscalls/ioprio_set.S
+++ b/libc/arch-x86/syscalls/ioprio_set.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(ioprio_set)
mov 24(%esp), %edx
movl $__NR_ioprio_set, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/kill.S b/libc/arch-x86/syscalls/kill.S
index 99fe9a99b..7c7dcb965 100644
--- a/libc/arch-x86/syscalls/kill.S
+++ b/libc/arch-x86/syscalls/kill.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(kill)
mov 16(%esp), %ecx
movl $__NR_kill, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/klogctl.S b/libc/arch-x86/syscalls/klogctl.S
index e9f8b792e..e6cac009b 100644
--- a/libc/arch-x86/syscalls/klogctl.S
+++ b/libc/arch-x86/syscalls/klogctl.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(klogctl)
mov 24(%esp), %edx
movl $__NR_syslog, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/lchown.S b/libc/arch-x86/syscalls/lchown.S
index 779f703fa..471c51fb9 100644
--- a/libc/arch-x86/syscalls/lchown.S
+++ b/libc/arch-x86/syscalls/lchown.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(lchown)
mov 24(%esp), %edx
movl $__NR_lchown32, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/lgetxattr.S b/libc/arch-x86/syscalls/lgetxattr.S
index 3781bfff5..0997262e5 100644
--- a/libc/arch-x86/syscalls/lgetxattr.S
+++ b/libc/arch-x86/syscalls/lgetxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(lgetxattr)
mov 32(%esp), %esi
movl $__NR_lgetxattr, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/link.S b/libc/arch-x86/syscalls/link.S
index dac7d0e94..96b8edc69 100644
--- a/libc/arch-x86/syscalls/link.S
+++ b/libc/arch-x86/syscalls/link.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(link)
mov 16(%esp), %ecx
movl $__NR_link, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/listen.S b/libc/arch-x86/syscalls/listen.S
index 8f63945d7..bf1aa77f1 100644
--- a/libc/arch-x86/syscalls/listen.S
+++ b/libc/arch-x86/syscalls/listen.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,7 @@ ENTRY(listen)
addl $12, %ecx
movl $__NR_socketcall, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/listxattr.S b/libc/arch-x86/syscalls/listxattr.S
index 853c47b38..ae8d351cf 100644
--- a/libc/arch-x86/syscalls/listxattr.S
+++ b/libc/arch-x86/syscalls/listxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(listxattr)
mov 24(%esp), %edx
movl $__NR_listxattr, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/llistxattr.S b/libc/arch-x86/syscalls/llistxattr.S
index cd7038b72..22fb6a901 100644
--- a/libc/arch-x86/syscalls/llistxattr.S
+++ b/libc/arch-x86/syscalls/llistxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(llistxattr)
mov 24(%esp), %edx
movl $__NR_llistxattr, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/lremovexattr.S b/libc/arch-x86/syscalls/lremovexattr.S
index 93973d6ef..3deae9582 100644
--- a/libc/arch-x86/syscalls/lremovexattr.S
+++ b/libc/arch-x86/syscalls/lremovexattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(lremovexattr)
mov 16(%esp), %ecx
movl $__NR_lremovexattr, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/lseek.S b/libc/arch-x86/syscalls/lseek.S
index f6250e610..d62983f0b 100644
--- a/libc/arch-x86/syscalls/lseek.S
+++ b/libc/arch-x86/syscalls/lseek.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(lseek)
mov 24(%esp), %edx
movl $__NR_lseek, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/lsetxattr.S b/libc/arch-x86/syscalls/lsetxattr.S
index c5dbc3062..f8f50aa92 100644
--- a/libc/arch-x86/syscalls/lsetxattr.S
+++ b/libc/arch-x86/syscalls/lsetxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -15,7 +16,7 @@ ENTRY(lsetxattr)
mov 40(%esp), %edi
movl $__NR_lsetxattr, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/lstat.S b/libc/arch-x86/syscalls/lstat.S
index 4e25faec9..dc2a36cd2 100644
--- a/libc/arch-x86/syscalls/lstat.S
+++ b/libc/arch-x86/syscalls/lstat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(lstat)
mov 16(%esp), %ecx
movl $__NR_lstat64, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/madvise.S b/libc/arch-x86/syscalls/madvise.S
index bf3e5dc90..a2827eb56 100644
--- a/libc/arch-x86/syscalls/madvise.S
+++ b/libc/arch-x86/syscalls/madvise.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(madvise)
mov 24(%esp), %edx
movl $__NR_madvise, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/mincore.S b/libc/arch-x86/syscalls/mincore.S
index 37df63920..0b6e129f2 100644
--- a/libc/arch-x86/syscalls/mincore.S
+++ b/libc/arch-x86/syscalls/mincore.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(mincore)
mov 24(%esp), %edx
movl $__NR_mincore, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/mkdir.S b/libc/arch-x86/syscalls/mkdir.S
index 16a5c0355..3256affe8 100644
--- a/libc/arch-x86/syscalls/mkdir.S
+++ b/libc/arch-x86/syscalls/mkdir.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(mkdir)
mov 16(%esp), %ecx
movl $__NR_mkdir, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/mkdirat.S b/libc/arch-x86/syscalls/mkdirat.S
index ece2c2707..9d872b150 100644
--- a/libc/arch-x86/syscalls/mkdirat.S
+++ b/libc/arch-x86/syscalls/mkdirat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(mkdirat)
mov 24(%esp), %edx
movl $__NR_mkdirat, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/mknod.S b/libc/arch-x86/syscalls/mknod.S
index 22fc390ff..ad06357e2 100644
--- a/libc/arch-x86/syscalls/mknod.S
+++ b/libc/arch-x86/syscalls/mknod.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(mknod)
mov 24(%esp), %edx
movl $__NR_mknod, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/mlock.S b/libc/arch-x86/syscalls/mlock.S
index 5010e0078..c07813874 100644
--- a/libc/arch-x86/syscalls/mlock.S
+++ b/libc/arch-x86/syscalls/mlock.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(mlock)
mov 16(%esp), %ecx
movl $__NR_mlock, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/mlockall.S b/libc/arch-x86/syscalls/mlockall.S
index 849b44f30..8251117f9 100644
--- a/libc/arch-x86/syscalls/mlockall.S
+++ b/libc/arch-x86/syscalls/mlockall.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(mlockall)
mov 8(%esp), %ebx
movl $__NR_mlockall, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/mount.S b/libc/arch-x86/syscalls/mount.S
index 9ceeab93d..e57c54d21 100644
--- a/libc/arch-x86/syscalls/mount.S
+++ b/libc/arch-x86/syscalls/mount.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -15,7 +16,7 @@ ENTRY(mount)
mov 40(%esp), %edi
movl $__NR_mount, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/mprotect.S b/libc/arch-x86/syscalls/mprotect.S
index 4438bfe41..c5b414a4a 100644
--- a/libc/arch-x86/syscalls/mprotect.S
+++ b/libc/arch-x86/syscalls/mprotect.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(mprotect)
mov 24(%esp), %edx
movl $__NR_mprotect, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/mremap.S b/libc/arch-x86/syscalls/mremap.S
index d33a8dc6f..ca40fd322 100644
--- a/libc/arch-x86/syscalls/mremap.S
+++ b/libc/arch-x86/syscalls/mremap.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(mremap)
mov 32(%esp), %esi
movl $__NR_mremap, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/msync.S b/libc/arch-x86/syscalls/msync.S
index 2da5bc748..3eb80149b 100644
--- a/libc/arch-x86/syscalls/msync.S
+++ b/libc/arch-x86/syscalls/msync.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(msync)
mov 24(%esp), %edx
movl $__NR_msync, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/munlock.S b/libc/arch-x86/syscalls/munlock.S
index 574d17b20..20249f941 100644
--- a/libc/arch-x86/syscalls/munlock.S
+++ b/libc/arch-x86/syscalls/munlock.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(munlock)
mov 16(%esp), %ecx
movl $__NR_munlock, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/munlockall.S b/libc/arch-x86/syscalls/munlockall.S
index f69316a16..18275ca64 100644
--- a/libc/arch-x86/syscalls/munlockall.S
+++ b/libc/arch-x86/syscalls/munlockall.S
@@ -1,11 +1,12 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(munlockall)
movl $__NR_munlockall, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/munmap.S b/libc/arch-x86/syscalls/munmap.S
index 91c73c1cf..22f3549c9 100644
--- a/libc/arch-x86/syscalls/munmap.S
+++ b/libc/arch-x86/syscalls/munmap.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(munmap)
mov 16(%esp), %ecx
movl $__NR_munmap, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/nanosleep.S b/libc/arch-x86/syscalls/nanosleep.S
index 6d2df089c..dc141210e 100644
--- a/libc/arch-x86/syscalls/nanosleep.S
+++ b/libc/arch-x86/syscalls/nanosleep.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(nanosleep)
mov 16(%esp), %ecx
movl $__NR_nanosleep, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/pause.S b/libc/arch-x86/syscalls/pause.S
index 70be691cb..8bc21d1a6 100644
--- a/libc/arch-x86/syscalls/pause.S
+++ b/libc/arch-x86/syscalls/pause.S
@@ -1,11 +1,12 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(pause)
movl $__NR_pause, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/perf_event_open.S b/libc/arch-x86/syscalls/perf_event_open.S
index 6466b45f3..e1ec6d842 100644
--- a/libc/arch-x86/syscalls/perf_event_open.S
+++ b/libc/arch-x86/syscalls/perf_event_open.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -15,7 +16,7 @@ ENTRY(perf_event_open)
mov 40(%esp), %edi
movl $__NR_perf_event_open, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/personality.S b/libc/arch-x86/syscalls/personality.S
index b23b5925a..7ae3dfb4b 100644
--- a/libc/arch-x86/syscalls/personality.S
+++ b/libc/arch-x86/syscalls/personality.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(personality)
mov 8(%esp), %ebx
movl $__NR_personality, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/pipe.S b/libc/arch-x86/syscalls/pipe.S
index 1560badff..583e868a6 100644
--- a/libc/arch-x86/syscalls/pipe.S
+++ b/libc/arch-x86/syscalls/pipe.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(pipe)
mov 8(%esp), %ebx
movl $__NR_pipe, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/pipe2.S b/libc/arch-x86/syscalls/pipe2.S
index 55fe08f4c..12a80337f 100644
--- a/libc/arch-x86/syscalls/pipe2.S
+++ b/libc/arch-x86/syscalls/pipe2.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(pipe2)
mov 16(%esp), %ecx
movl $__NR_pipe2, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/poll.S b/libc/arch-x86/syscalls/poll.S
index 541d65732..7d7608a81 100644
--- a/libc/arch-x86/syscalls/poll.S
+++ b/libc/arch-x86/syscalls/poll.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(poll)
mov 24(%esp), %edx
movl $__NR_poll, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/prctl.S b/libc/arch-x86/syscalls/prctl.S
index 56720fe28..f8dcc288d 100644
--- a/libc/arch-x86/syscalls/prctl.S
+++ b/libc/arch-x86/syscalls/prctl.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -15,7 +16,7 @@ ENTRY(prctl)
mov 40(%esp), %edi
movl $__NR_prctl, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/pread64.S b/libc/arch-x86/syscalls/pread64.S
index 987e9b8e9..ff12f5548 100644
--- a/libc/arch-x86/syscalls/pread64.S
+++ b/libc/arch-x86/syscalls/pread64.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -15,7 +16,7 @@ ENTRY(pread64)
mov 40(%esp), %edi
movl $__NR_pread64, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/pwrite64.S b/libc/arch-x86/syscalls/pwrite64.S
index 8773a2081..6c0050840 100644
--- a/libc/arch-x86/syscalls/pwrite64.S
+++ b/libc/arch-x86/syscalls/pwrite64.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -15,7 +16,7 @@ ENTRY(pwrite64)
mov 40(%esp), %edi
movl $__NR_pwrite64, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/read.S b/libc/arch-x86/syscalls/read.S
index 98b7c12eb..be6348758 100644
--- a/libc/arch-x86/syscalls/read.S
+++ b/libc/arch-x86/syscalls/read.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(read)
mov 24(%esp), %edx
movl $__NR_read, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/readahead.S b/libc/arch-x86/syscalls/readahead.S
index b0c00185a..78584cc96 100644
--- a/libc/arch-x86/syscalls/readahead.S
+++ b/libc/arch-x86/syscalls/readahead.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(readahead)
mov 32(%esp), %esi
movl $__NR_readahead, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/readlink.S b/libc/arch-x86/syscalls/readlink.S
index 393b5d41d..e75a2c0d8 100644
--- a/libc/arch-x86/syscalls/readlink.S
+++ b/libc/arch-x86/syscalls/readlink.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(readlink)
mov 24(%esp), %edx
movl $__NR_readlink, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/readv.S b/libc/arch-x86/syscalls/readv.S
index d626068a3..699295d19 100644
--- a/libc/arch-x86/syscalls/readv.S
+++ b/libc/arch-x86/syscalls/readv.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(readv)
mov 24(%esp), %edx
movl $__NR_readv, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/recvfrom.S b/libc/arch-x86/syscalls/recvfrom.S
index 98558e142..acbc1665e 100644
--- a/libc/arch-x86/syscalls/recvfrom.S
+++ b/libc/arch-x86/syscalls/recvfrom.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,7 @@ ENTRY(recvfrom)
addl $12, %ecx
movl $__NR_socketcall, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/recvmsg.S b/libc/arch-x86/syscalls/recvmsg.S
index 8b3c7bd51..b85abb505 100644
--- a/libc/arch-x86/syscalls/recvmsg.S
+++ b/libc/arch-x86/syscalls/recvmsg.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,7 @@ ENTRY(recvmsg)
addl $12, %ecx
movl $__NR_socketcall, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/removexattr.S b/libc/arch-x86/syscalls/removexattr.S
index e2211e84c..c0af7e7c5 100644
--- a/libc/arch-x86/syscalls/removexattr.S
+++ b/libc/arch-x86/syscalls/removexattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(removexattr)
mov 16(%esp), %ecx
movl $__NR_removexattr, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/rename.S b/libc/arch-x86/syscalls/rename.S
index 43be21028..955bb7494 100644
--- a/libc/arch-x86/syscalls/rename.S
+++ b/libc/arch-x86/syscalls/rename.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(rename)
mov 16(%esp), %ecx
movl $__NR_rename, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/renameat.S b/libc/arch-x86/syscalls/renameat.S
index 8084045f8..d4b9f2492 100644
--- a/libc/arch-x86/syscalls/renameat.S
+++ b/libc/arch-x86/syscalls/renameat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(renameat)
mov 32(%esp), %esi
movl $__NR_renameat, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/rmdir.S b/libc/arch-x86/syscalls/rmdir.S
index b16375c52..a9025b082 100644
--- a/libc/arch-x86/syscalls/rmdir.S
+++ b/libc/arch-x86/syscalls/rmdir.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(rmdir)
mov 8(%esp), %ebx
movl $__NR_rmdir, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sched_get_priority_max.S b/libc/arch-x86/syscalls/sched_get_priority_max.S
index 713b02d31..281f4d76c 100644
--- a/libc/arch-x86/syscalls/sched_get_priority_max.S
+++ b/libc/arch-x86/syscalls/sched_get_priority_max.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(sched_get_priority_max)
mov 8(%esp), %ebx
movl $__NR_sched_get_priority_max, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sched_get_priority_min.S b/libc/arch-x86/syscalls/sched_get_priority_min.S
index de6768fe0..41b2e6555 100644
--- a/libc/arch-x86/syscalls/sched_get_priority_min.S
+++ b/libc/arch-x86/syscalls/sched_get_priority_min.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(sched_get_priority_min)
mov 8(%esp), %ebx
movl $__NR_sched_get_priority_min, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sched_getparam.S b/libc/arch-x86/syscalls/sched_getparam.S
index eabc562cb..131d919ee 100644
--- a/libc/arch-x86/syscalls/sched_getparam.S
+++ b/libc/arch-x86/syscalls/sched_getparam.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(sched_getparam)
mov 16(%esp), %ecx
movl $__NR_sched_getparam, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sched_getscheduler.S b/libc/arch-x86/syscalls/sched_getscheduler.S
index 2a6c8f798..da8578bd0 100644
--- a/libc/arch-x86/syscalls/sched_getscheduler.S
+++ b/libc/arch-x86/syscalls/sched_getscheduler.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(sched_getscheduler)
mov 8(%esp), %ebx
movl $__NR_sched_getscheduler, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sched_rr_get_interval.S b/libc/arch-x86/syscalls/sched_rr_get_interval.S
index 3f032d5b5..3ce976aea 100644
--- a/libc/arch-x86/syscalls/sched_rr_get_interval.S
+++ b/libc/arch-x86/syscalls/sched_rr_get_interval.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(sched_rr_get_interval)
mov 16(%esp), %ecx
movl $__NR_sched_rr_get_interval, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sched_setaffinity.S b/libc/arch-x86/syscalls/sched_setaffinity.S
index 988f6b4bb..89b42eb87 100644
--- a/libc/arch-x86/syscalls/sched_setaffinity.S
+++ b/libc/arch-x86/syscalls/sched_setaffinity.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(sched_setaffinity)
mov 24(%esp), %edx
movl $__NR_sched_setaffinity, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sched_setparam.S b/libc/arch-x86/syscalls/sched_setparam.S
index a250783fd..4327d0449 100644
--- a/libc/arch-x86/syscalls/sched_setparam.S
+++ b/libc/arch-x86/syscalls/sched_setparam.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(sched_setparam)
mov 16(%esp), %ecx
movl $__NR_sched_setparam, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sched_setscheduler.S b/libc/arch-x86/syscalls/sched_setscheduler.S
index c6851ba87..9fdb5e660 100644
--- a/libc/arch-x86/syscalls/sched_setscheduler.S
+++ b/libc/arch-x86/syscalls/sched_setscheduler.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(sched_setscheduler)
mov 24(%esp), %edx
movl $__NR_sched_setscheduler, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sched_yield.S b/libc/arch-x86/syscalls/sched_yield.S
index 3dcc7fc6d..774aca446 100644
--- a/libc/arch-x86/syscalls/sched_yield.S
+++ b/libc/arch-x86/syscalls/sched_yield.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(sched_yield)
mov 8(%esp), %ebx
movl $__NR_sched_yield, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/select.S b/libc/arch-x86/syscalls/select.S
index b66528183..994361817 100644
--- a/libc/arch-x86/syscalls/select.S
+++ b/libc/arch-x86/syscalls/select.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -15,7 +16,7 @@ ENTRY(select)
mov 40(%esp), %edi
movl $__NR__newselect, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sendfile.S b/libc/arch-x86/syscalls/sendfile.S
index b36fa1fc7..b2dd94b15 100644
--- a/libc/arch-x86/syscalls/sendfile.S
+++ b/libc/arch-x86/syscalls/sendfile.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(sendfile)
mov 32(%esp), %esi
movl $__NR_sendfile, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sendmsg.S b/libc/arch-x86/syscalls/sendmsg.S
index 119d63280..93b504712 100644
--- a/libc/arch-x86/syscalls/sendmsg.S
+++ b/libc/arch-x86/syscalls/sendmsg.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,7 @@ ENTRY(sendmsg)
addl $12, %ecx
movl $__NR_socketcall, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sendto.S b/libc/arch-x86/syscalls/sendto.S
index 82208fe1d..b0ecd86e4 100644
--- a/libc/arch-x86/syscalls/sendto.S
+++ b/libc/arch-x86/syscalls/sendto.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,7 @@ ENTRY(sendto)
addl $12, %ecx
movl $__NR_socketcall, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/setgid.S b/libc/arch-x86/syscalls/setgid.S
index 37f5ffe69..853fea365 100644
--- a/libc/arch-x86/syscalls/setgid.S
+++ b/libc/arch-x86/syscalls/setgid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(setgid)
mov 8(%esp), %ebx
movl $__NR_setgid32, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/setgroups.S b/libc/arch-x86/syscalls/setgroups.S
index 20266e0b0..e68a971c5 100644
--- a/libc/arch-x86/syscalls/setgroups.S
+++ b/libc/arch-x86/syscalls/setgroups.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(setgroups)
mov 16(%esp), %ecx
movl $__NR_setgroups32, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/setitimer.S b/libc/arch-x86/syscalls/setitimer.S
index 97ee7c647..246e8da14 100644
--- a/libc/arch-x86/syscalls/setitimer.S
+++ b/libc/arch-x86/syscalls/setitimer.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(setitimer)
mov 24(%esp), %edx
movl $__NR_setitimer, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/setpgid.S b/libc/arch-x86/syscalls/setpgid.S
index 8ff927355..878662bd7 100644
--- a/libc/arch-x86/syscalls/setpgid.S
+++ b/libc/arch-x86/syscalls/setpgid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(setpgid)
mov 16(%esp), %ecx
movl $__NR_setpgid, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/setpriority.S b/libc/arch-x86/syscalls/setpriority.S
index 7358a8900..65ba7d5f1 100644
--- a/libc/arch-x86/syscalls/setpriority.S
+++ b/libc/arch-x86/syscalls/setpriority.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(setpriority)
mov 24(%esp), %edx
movl $__NR_setpriority, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/setregid.S b/libc/arch-x86/syscalls/setregid.S
index bbe092fe8..58a5afdac 100644
--- a/libc/arch-x86/syscalls/setregid.S
+++ b/libc/arch-x86/syscalls/setregid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(setregid)
mov 16(%esp), %ecx
movl $__NR_setregid32, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/setresgid.S b/libc/arch-x86/syscalls/setresgid.S
index c2358374a..efda6e64f 100644
--- a/libc/arch-x86/syscalls/setresgid.S
+++ b/libc/arch-x86/syscalls/setresgid.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(setresgid)
mov 24(%esp), %edx
movl $__NR_setresgid32, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/setrlimit.S b/libc/arch-x86/syscalls/setrlimit.S
index d7f507246..b73faafc5 100644
--- a/libc/arch-x86/syscalls/setrlimit.S
+++ b/libc/arch-x86/syscalls/setrlimit.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(setrlimit)
mov 16(%esp), %ecx
movl $__NR_setrlimit, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/setsid.S b/libc/arch-x86/syscalls/setsid.S
index 684b304a2..59b3bbb5f 100644
--- a/libc/arch-x86/syscalls/setsid.S
+++ b/libc/arch-x86/syscalls/setsid.S
@@ -1,11 +1,12 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(setsid)
movl $__NR_setsid, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/setsockopt.S b/libc/arch-x86/syscalls/setsockopt.S
index 9c701166d..486e9eb2c 100644
--- a/libc/arch-x86/syscalls/setsockopt.S
+++ b/libc/arch-x86/syscalls/setsockopt.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,7 @@ ENTRY(setsockopt)
addl $12, %ecx
movl $__NR_socketcall, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/settimeofday.S b/libc/arch-x86/syscalls/settimeofday.S
index bc95fec01..616b551a8 100644
--- a/libc/arch-x86/syscalls/settimeofday.S
+++ b/libc/arch-x86/syscalls/settimeofday.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(settimeofday)
mov 16(%esp), %ecx
movl $__NR_settimeofday, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/setxattr.S b/libc/arch-x86/syscalls/setxattr.S
index 9dc87e3a8..30752f8c5 100644
--- a/libc/arch-x86/syscalls/setxattr.S
+++ b/libc/arch-x86/syscalls/setxattr.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -15,7 +16,7 @@ ENTRY(setxattr)
mov 40(%esp), %edi
movl $__NR_setxattr, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/shutdown.S b/libc/arch-x86/syscalls/shutdown.S
index 7fa36a1f2..697107cea 100644
--- a/libc/arch-x86/syscalls/shutdown.S
+++ b/libc/arch-x86/syscalls/shutdown.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,7 @@ ENTRY(shutdown)
addl $12, %ecx
movl $__NR_socketcall, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sigaction.S b/libc/arch-x86/syscalls/sigaction.S
index 4fd5993c1..7f2cfd18e 100644
--- a/libc/arch-x86/syscalls/sigaction.S
+++ b/libc/arch-x86/syscalls/sigaction.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(sigaction)
mov 24(%esp), %edx
movl $__NR_sigaction, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sigaltstack.S b/libc/arch-x86/syscalls/sigaltstack.S
index 830c99ff0..6adf9a73f 100644
--- a/libc/arch-x86/syscalls/sigaltstack.S
+++ b/libc/arch-x86/syscalls/sigaltstack.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(sigaltstack)
mov 16(%esp), %ecx
movl $__NR_sigaltstack, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/signalfd4.S b/libc/arch-x86/syscalls/signalfd4.S
index 57e0233be..a2c75278e 100644
--- a/libc/arch-x86/syscalls/signalfd4.S
+++ b/libc/arch-x86/syscalls/signalfd4.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(signalfd4)
mov 32(%esp), %esi
movl $__NR_signalfd4, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sigpending.S b/libc/arch-x86/syscalls/sigpending.S
index 2f009b2ee..34af79d4a 100644
--- a/libc/arch-x86/syscalls/sigpending.S
+++ b/libc/arch-x86/syscalls/sigpending.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(sigpending)
mov 8(%esp), %ebx
movl $__NR_sigpending, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sigprocmask.S b/libc/arch-x86/syscalls/sigprocmask.S
index 81cdfa2c7..12390a587 100644
--- a/libc/arch-x86/syscalls/sigprocmask.S
+++ b/libc/arch-x86/syscalls/sigprocmask.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(sigprocmask)
mov 24(%esp), %edx
movl $__NR_sigprocmask, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/socket.S b/libc/arch-x86/syscalls/socket.S
index 8cc93bd7a..c9f63b0c5 100644
--- a/libc/arch-x86/syscalls/socket.S
+++ b/libc/arch-x86/syscalls/socket.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,7 @@ ENTRY(socket)
addl $12, %ecx
movl $__NR_socketcall, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/socketpair.S b/libc/arch-x86/syscalls/socketpair.S
index ccfc847f3..6ea3edc2a 100644
--- a/libc/arch-x86/syscalls/socketpair.S
+++ b/libc/arch-x86/syscalls/socketpair.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -10,7 +11,7 @@ ENTRY(socketpair)
addl $12, %ecx
movl $__NR_socketcall, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/stat.S b/libc/arch-x86/syscalls/stat.S
index 83d1af8de..cd2d291f9 100644
--- a/libc/arch-x86/syscalls/stat.S
+++ b/libc/arch-x86/syscalls/stat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(stat)
mov 16(%esp), %ecx
movl $__NR_stat64, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/symlink.S b/libc/arch-x86/syscalls/symlink.S
index dbc5490cb..86415f1eb 100644
--- a/libc/arch-x86/syscalls/symlink.S
+++ b/libc/arch-x86/syscalls/symlink.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(symlink)
mov 16(%esp), %ecx
movl $__NR_symlink, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sync.S b/libc/arch-x86/syscalls/sync.S
index f337c2c3d..2126a6ac7 100644
--- a/libc/arch-x86/syscalls/sync.S
+++ b/libc/arch-x86/syscalls/sync.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(sync)
mov 8(%esp), %ebx
movl $__NR_sync, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/sysinfo.S b/libc/arch-x86/syscalls/sysinfo.S
index ef9fcb050..42dcea3d0 100644
--- a/libc/arch-x86/syscalls/sysinfo.S
+++ b/libc/arch-x86/syscalls/sysinfo.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(sysinfo)
mov 8(%esp), %ebx
movl $__NR_sysinfo, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/tgkill.S b/libc/arch-x86/syscalls/tgkill.S
index 6d5dc8828..ad7a94ad6 100644
--- a/libc/arch-x86/syscalls/tgkill.S
+++ b/libc/arch-x86/syscalls/tgkill.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(tgkill)
mov 24(%esp), %edx
movl $__NR_tgkill, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/times.S b/libc/arch-x86/syscalls/times.S
index 04991a8ea..b4dec257b 100644
--- a/libc/arch-x86/syscalls/times.S
+++ b/libc/arch-x86/syscalls/times.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(times)
mov 8(%esp), %ebx
movl $__NR_times, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/tkill.S b/libc/arch-x86/syscalls/tkill.S
index 51eb1c869..89ece49b5 100644
--- a/libc/arch-x86/syscalls/tkill.S
+++ b/libc/arch-x86/syscalls/tkill.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(tkill)
mov 16(%esp), %ecx
movl $__NR_tkill, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/truncate.S b/libc/arch-x86/syscalls/truncate.S
index 9e9b08d9e..60f30eb23 100644
--- a/libc/arch-x86/syscalls/truncate.S
+++ b/libc/arch-x86/syscalls/truncate.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(truncate)
mov 16(%esp), %ecx
movl $__NR_truncate, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/umask.S b/libc/arch-x86/syscalls/umask.S
index f2bf7b0ce..4942c4379 100644
--- a/libc/arch-x86/syscalls/umask.S
+++ b/libc/arch-x86/syscalls/umask.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(umask)
mov 8(%esp), %ebx
movl $__NR_umask, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/umount2.S b/libc/arch-x86/syscalls/umount2.S
index 194948938..3c5415075 100644
--- a/libc/arch-x86/syscalls/umount2.S
+++ b/libc/arch-x86/syscalls/umount2.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(umount2)
mov 16(%esp), %ecx
movl $__NR_umount2, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/uname.S b/libc/arch-x86/syscalls/uname.S
index 9b2c74642..310ac7f70 100644
--- a/libc/arch-x86/syscalls/uname.S
+++ b/libc/arch-x86/syscalls/uname.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(uname)
mov 8(%esp), %ebx
movl $__NR_uname, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/unlink.S b/libc/arch-x86/syscalls/unlink.S
index 0d9ce84df..d58bfb812 100644
--- a/libc/arch-x86/syscalls/unlink.S
+++ b/libc/arch-x86/syscalls/unlink.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(unlink)
mov 8(%esp), %ebx
movl $__NR_unlink, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/unlinkat.S b/libc/arch-x86/syscalls/unlinkat.S
index d05b4880f..85499c26d 100644
--- a/libc/arch-x86/syscalls/unlinkat.S
+++ b/libc/arch-x86/syscalls/unlinkat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(unlinkat)
mov 24(%esp), %edx
movl $__NR_unlinkat, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/unshare.S b/libc/arch-x86/syscalls/unshare.S
index da0f563e4..883ad40c7 100644
--- a/libc/arch-x86/syscalls/unshare.S
+++ b/libc/arch-x86/syscalls/unshare.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -7,7 +8,7 @@ ENTRY(unshare)
mov 8(%esp), %ebx
movl $__NR_unshare, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/utimensat.S b/libc/arch-x86/syscalls/utimensat.S
index fb1d630da..739d4869e 100644
--- a/libc/arch-x86/syscalls/utimensat.S
+++ b/libc/arch-x86/syscalls/utimensat.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -13,7 +14,7 @@ ENTRY(utimensat)
mov 32(%esp), %esi
movl $__NR_utimensat, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/utimes.S b/libc/arch-x86/syscalls/utimes.S
index 189f6b9a1..b6c603691 100644
--- a/libc/arch-x86/syscalls/utimes.S
+++ b/libc/arch-x86/syscalls/utimes.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -9,7 +10,7 @@ ENTRY(utimes)
mov 16(%esp), %ecx
movl $__NR_utimes, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/write.S b/libc/arch-x86/syscalls/write.S
index 7f0b0301a..8dd79a2c6 100644
--- a/libc/arch-x86/syscalls/write.S
+++ b/libc/arch-x86/syscalls/write.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(write)
mov 24(%esp), %edx
movl $__NR_write, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/arch-x86/syscalls/writev.S b/libc/arch-x86/syscalls/writev.S
index 0757a444e..c442a1973 100644
--- a/libc/arch-x86/syscalls/writev.S
+++ b/libc/arch-x86/syscalls/writev.S
@@ -1,4 +1,5 @@
/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -11,7 +12,7 @@ ENTRY(writev)
mov 24(%esp), %edx
movl $__NR_writev, %eax
int $0x80
- cmpl $-129, %eax
+ cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
diff --git a/libc/bionic/__set_errno.cpp b/libc/bionic/__set_errno.cpp
index c69ca8707..4e72093b7 100644
--- a/libc/bionic/__set_errno.cpp
+++ b/libc/bionic/__set_errno.cpp
@@ -27,25 +27,11 @@
*/
#include <errno.h>
-#include <linux/err.h>
-#define unlikely(x) __builtin_expect((x), false) // Used but not defined by <linux/err.h>.
-
-// These functions are called from our assembler syscall stubs.
+// This function is called from our assembler syscall stubs.
// C/C++ code should just assign 'errno' instead.
-// TODO: should be __LIBC_HIDDEN__, but already exported by NDK :-(
-// TODO: this isn't used on ARM.
-extern "C" int __set_errno(int n) {
+extern "C" __LIBC_HIDDEN__ int __set_errno(int n) {
errno = n;
return -1;
}
-
-// TODO: this is only used on ARM, but is exported by NDK on all platforms :-(
-extern "C" __LIBC_HIDDEN__ int __set_syscall_errno(unsigned long n) {
- if (IS_ERR_VALUE(n)) {
- errno = -n;
- return -1;
- }
- return n;
-}
diff --git a/libc/kernel/common/linux/err.h b/libc/kernel/common/linux/err.h
index 442a1d890..ae0cf3cdc 100644
--- a/libc/kernel/common/linux/err.h
+++ b/libc/kernel/common/linux/err.h
@@ -22,5 +22,8 @@
#include <asm/errno.h>
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define MAX_ERRNO 4095
+#ifndef __ASSEMBLY__
#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
diff --git a/libc/tools/gensyscalls.py b/libc/tools/gensyscalls.py
index 5e519de79..91e7a5783 100755
--- a/libc/tools/gensyscalls.py
+++ b/libc/tools/gensyscalls.py
@@ -46,6 +46,7 @@ def create_file( relpath ):
#
x86_header = """/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -56,7 +57,7 @@ x86_registers = [ "%ebx", "%ecx", "%edx", "%esi", "%edi", "%ebp" ]
x86_call = """ movl $%(idname)s, %%eax
int $0x80
- cmpl $-129, %%eax
+ cmpl $-MAX_ERRNO, %%eax
jb 1f
negl %%eax
pushl %%eax
@@ -75,6 +76,7 @@ END(%(fname)s)
#
arm_header = """/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
@@ -86,9 +88,10 @@ arm_eabi_call_default = arm_header + """\
ldr r7, =%(idname)s
swi #0
mov r7, ip
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(%(fname)s)
"""
@@ -100,9 +103,10 @@ arm_eabi_call_long = arm_header + """\
ldr r7, =%(idname)s
swi #0
ldmfd sp!, {r4, r5, r6, r7}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
+ cmn r0, #(MAX_ERRNO + 1)
+ bxls lr
+ neg r0, r0
+ b __set_errno
END(%(fname)s)
"""