Move away from the __ARCH_WANT_SYSCALL_NO_AT system calls.
Modern architectures only get the *at(2) system calls. For example,
aarch64 doesn't have open(2), and expects userspace to use openat(2)
instead.
Change-Id: I87b4ed79790cb8a80844f5544ac1a13fda26c7b5
diff --git a/libc/arch-x86/syscalls.mk b/libc/arch-x86/syscalls.mk
index 5494992..5d1edaa 100644
--- a/libc/arch-x86/syscalls.mk
+++ b/libc/arch-x86/syscalls.mk
@@ -36,14 +36,11 @@
syscall_src += arch-x86/syscalls/_exit_thread.S
syscall_src += arch-x86/syscalls/_waitpid.S
syscall_src += arch-x86/syscalls/accept.S
-syscall_src += arch-x86/syscalls/access.S
syscall_src += arch-x86/syscalls/acct.S
syscall_src += arch-x86/syscalls/bind.S
syscall_src += arch-x86/syscalls/capget.S
syscall_src += arch-x86/syscalls/capset.S
syscall_src += arch-x86/syscalls/chdir.S
-syscall_src += arch-x86/syscalls/chmod.S
-syscall_src += arch-x86/syscalls/chown.S
syscall_src += arch-x86/syscalls/chroot.S
syscall_src += arch-x86/syscalls/clock_getres.S
syscall_src += arch-x86/syscalls/clock_gettime.S
@@ -106,21 +103,18 @@
syscall_src += arch-x86/syscalls/ioprio_set.S
syscall_src += arch-x86/syscalls/kill.S
syscall_src += arch-x86/syscalls/klogctl.S
-syscall_src += arch-x86/syscalls/lchown.S
syscall_src += arch-x86/syscalls/lgetxattr.S
-syscall_src += arch-x86/syscalls/link.S
+syscall_src += arch-x86/syscalls/linkat.S
syscall_src += arch-x86/syscalls/listen.S
syscall_src += arch-x86/syscalls/listxattr.S
syscall_src += arch-x86/syscalls/llistxattr.S
syscall_src += arch-x86/syscalls/lremovexattr.S
syscall_src += arch-x86/syscalls/lseek.S
syscall_src += arch-x86/syscalls/lsetxattr.S
-syscall_src += arch-x86/syscalls/lstat.S
syscall_src += arch-x86/syscalls/madvise.S
syscall_src += arch-x86/syscalls/mincore.S
-syscall_src += arch-x86/syscalls/mkdir.S
syscall_src += arch-x86/syscalls/mkdirat.S
-syscall_src += arch-x86/syscalls/mknod.S
+syscall_src += arch-x86/syscalls/mknodat.S
syscall_src += arch-x86/syscalls/mlock.S
syscall_src += arch-x86/syscalls/mlockall.S
syscall_src += arch-x86/syscalls/mount.S
@@ -142,14 +136,12 @@
syscall_src += arch-x86/syscalls/pwrite64.S
syscall_src += arch-x86/syscalls/read.S
syscall_src += arch-x86/syscalls/readahead.S
-syscall_src += arch-x86/syscalls/readlink.S
+syscall_src += arch-x86/syscalls/readlinkat.S
syscall_src += arch-x86/syscalls/readv.S
syscall_src += arch-x86/syscalls/recvfrom.S
syscall_src += arch-x86/syscalls/recvmsg.S
syscall_src += arch-x86/syscalls/removexattr.S
-syscall_src += arch-x86/syscalls/rename.S
syscall_src += arch-x86/syscalls/renameat.S
-syscall_src += arch-x86/syscalls/rmdir.S
syscall_src += arch-x86/syscalls/sched_get_priority_max.S
syscall_src += arch-x86/syscalls/sched_get_priority_min.S
syscall_src += arch-x86/syscalls/sched_getparam.S
@@ -184,10 +176,9 @@
syscall_src += arch-x86/syscalls/signalfd4.S
syscall_src += arch-x86/syscalls/socket.S
syscall_src += arch-x86/syscalls/socketpair.S
-syscall_src += arch-x86/syscalls/stat.S
syscall_src += arch-x86/syscalls/swapoff.S
syscall_src += arch-x86/syscalls/swapon.S
-syscall_src += arch-x86/syscalls/symlink.S
+syscall_src += arch-x86/syscalls/symlinkat.S
syscall_src += arch-x86/syscalls/sync.S
syscall_src += arch-x86/syscalls/sysinfo.S
syscall_src += arch-x86/syscalls/tgkill.S
@@ -201,11 +192,9 @@
syscall_src += arch-x86/syscalls/umask.S
syscall_src += arch-x86/syscalls/umount2.S
syscall_src += arch-x86/syscalls/uname.S
-syscall_src += arch-x86/syscalls/unlink.S
syscall_src += arch-x86/syscalls/unlinkat.S
syscall_src += arch-x86/syscalls/unshare.S
syscall_src += arch-x86/syscalls/utimensat.S
-syscall_src += arch-x86/syscalls/utimes.S
syscall_src += arch-x86/syscalls/wait4.S
syscall_src += arch-x86/syscalls/write.S
syscall_src += arch-x86/syscalls/writev.S
diff --git a/libc/arch-x86/syscalls/access.S b/libc/arch-x86/syscalls/access.S
deleted file mode 100644
index 0a553ed..0000000
--- a/libc/arch-x86/syscalls/access.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(access)
- pushl %ebx
- pushl %ecx
- mov 12(%esp), %ebx
- mov 16(%esp), %ecx
- movl $__NR_access, %eax
- int $0x80
- cmpl $-MAX_ERRNO, %eax
- jb 1f
- negl %eax
- pushl %eax
- call __set_errno
- addl $4, %esp
- orl $-1, %eax
-1:
- popl %ecx
- popl %ebx
- ret
-END(access)
diff --git a/libc/arch-x86/syscalls/chmod.S b/libc/arch-x86/syscalls/chmod.S
deleted file mode 100644
index 5718f8f..0000000
--- a/libc/arch-x86/syscalls/chmod.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(chmod)
- pushl %ebx
- pushl %ecx
- mov 12(%esp), %ebx
- mov 16(%esp), %ecx
- movl $__NR_chmod, %eax
- int $0x80
- cmpl $-MAX_ERRNO, %eax
- jb 1f
- negl %eax
- pushl %eax
- call __set_errno
- addl $4, %esp
- orl $-1, %eax
-1:
- popl %ecx
- popl %ebx
- ret
-END(chmod)
diff --git a/libc/arch-x86/syscalls/chown.S b/libc/arch-x86/syscalls/chown.S
deleted file mode 100644
index 5706da1..0000000
--- a/libc/arch-x86/syscalls/chown.S
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(chown)
- pushl %ebx
- pushl %ecx
- pushl %edx
- mov 16(%esp), %ebx
- mov 20(%esp), %ecx
- mov 24(%esp), %edx
- movl $__NR_chown32, %eax
- int $0x80
- cmpl $-MAX_ERRNO, %eax
- jb 1f
- negl %eax
- pushl %eax
- call __set_errno
- addl $4, %esp
- orl $-1, %eax
-1:
- popl %edx
- popl %ecx
- popl %ebx
- ret
-END(chown)
diff --git a/libc/arch-x86/syscalls/lchown.S b/libc/arch-x86/syscalls/lchown.S
deleted file mode 100644
index 7f4589a..0000000
--- a/libc/arch-x86/syscalls/lchown.S
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(lchown)
- pushl %ebx
- pushl %ecx
- pushl %edx
- mov 16(%esp), %ebx
- mov 20(%esp), %ecx
- mov 24(%esp), %edx
- movl $__NR_lchown32, %eax
- int $0x80
- cmpl $-MAX_ERRNO, %eax
- jb 1f
- negl %eax
- pushl %eax
- call __set_errno
- addl $4, %esp
- orl $-1, %eax
-1:
- popl %edx
- popl %ecx
- popl %ebx
- ret
-END(lchown)
diff --git a/libc/arch-x86/syscalls/link.S b/libc/arch-x86/syscalls/link.S
deleted file mode 100644
index 15d67c4..0000000
--- a/libc/arch-x86/syscalls/link.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(link)
- pushl %ebx
- pushl %ecx
- mov 12(%esp), %ebx
- mov 16(%esp), %ecx
- movl $__NR_link, %eax
- int $0x80
- cmpl $-MAX_ERRNO, %eax
- jb 1f
- negl %eax
- pushl %eax
- call __set_errno
- addl $4, %esp
- orl $-1, %eax
-1:
- popl %ecx
- popl %ebx
- ret
-END(link)
diff --git a/libc/arch-x86/syscalls/readlink.S b/libc/arch-x86/syscalls/linkat.S
similarity index 60%
copy from libc/arch-x86/syscalls/readlink.S
copy to libc/arch-x86/syscalls/linkat.S
index 4a279dc..652f346 100644
--- a/libc/arch-x86/syscalls/readlink.S
+++ b/libc/arch-x86/syscalls/linkat.S
@@ -4,14 +4,18 @@
#include <linux/err.h>
#include <machine/asm.h>
-ENTRY(readlink)
+ENTRY(linkat)
pushl %ebx
pushl %ecx
pushl %edx
- mov 16(%esp), %ebx
- mov 20(%esp), %ecx
- mov 24(%esp), %edx
- movl $__NR_readlink, %eax
+ pushl %esi
+ pushl %edi
+ mov 24(%esp), %ebx
+ mov 28(%esp), %ecx
+ mov 32(%esp), %edx
+ mov 36(%esp), %esi
+ mov 40(%esp), %edi
+ movl $__NR_linkat, %eax
int $0x80
cmpl $-MAX_ERRNO, %eax
jb 1f
@@ -21,8 +25,10 @@
addl $4, %esp
orl $-1, %eax
1:
+ popl %edi
+ popl %esi
popl %edx
popl %ecx
popl %ebx
ret
-END(readlink)
+END(linkat)
diff --git a/libc/arch-x86/syscalls/lstat.S b/libc/arch-x86/syscalls/lstat.S
deleted file mode 100644
index 23a0dcf..0000000
--- a/libc/arch-x86/syscalls/lstat.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(lstat)
- pushl %ebx
- pushl %ecx
- mov 12(%esp), %ebx
- mov 16(%esp), %ecx
- movl $__NR_lstat64, %eax
- int $0x80
- cmpl $-MAX_ERRNO, %eax
- jb 1f
- negl %eax
- pushl %eax
- call __set_errno
- addl $4, %esp
- orl $-1, %eax
-1:
- popl %ecx
- popl %ebx
- ret
-END(lstat)
diff --git a/libc/arch-x86/syscalls/mkdir.S b/libc/arch-x86/syscalls/mkdir.S
deleted file mode 100644
index d242ce2..0000000
--- a/libc/arch-x86/syscalls/mkdir.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(mkdir)
- pushl %ebx
- pushl %ecx
- mov 12(%esp), %ebx
- mov 16(%esp), %ecx
- movl $__NR_mkdir, %eax
- int $0x80
- cmpl $-MAX_ERRNO, %eax
- jb 1f
- negl %eax
- pushl %eax
- call __set_errno
- addl $4, %esp
- orl $-1, %eax
-1:
- popl %ecx
- popl %ebx
- ret
-END(mkdir)
diff --git a/libc/arch-x86/syscalls/mknod.S b/libc/arch-x86/syscalls/mknod.S
deleted file mode 100644
index e270384..0000000
--- a/libc/arch-x86/syscalls/mknod.S
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(mknod)
- pushl %ebx
- pushl %ecx
- pushl %edx
- mov 16(%esp), %ebx
- mov 20(%esp), %ecx
- mov 24(%esp), %edx
- movl $__NR_mknod, %eax
- int $0x80
- cmpl $-MAX_ERRNO, %eax
- jb 1f
- negl %eax
- pushl %eax
- call __set_errno
- addl $4, %esp
- orl $-1, %eax
-1:
- popl %edx
- popl %ecx
- popl %ebx
- ret
-END(mknod)
diff --git a/libc/arch-x86/syscalls/readlink.S b/libc/arch-x86/syscalls/mknodat.S
similarity index 66%
copy from libc/arch-x86/syscalls/readlink.S
copy to libc/arch-x86/syscalls/mknodat.S
index 4a279dc..8e53940 100644
--- a/libc/arch-x86/syscalls/readlink.S
+++ b/libc/arch-x86/syscalls/mknodat.S
@@ -4,14 +4,16 @@
#include <linux/err.h>
#include <machine/asm.h>
-ENTRY(readlink)
+ENTRY(mknodat)
pushl %ebx
pushl %ecx
pushl %edx
- mov 16(%esp), %ebx
- mov 20(%esp), %ecx
- mov 24(%esp), %edx
- movl $__NR_readlink, %eax
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_mknodat, %eax
int $0x80
cmpl $-MAX_ERRNO, %eax
jb 1f
@@ -21,8 +23,9 @@
addl $4, %esp
orl $-1, %eax
1:
+ popl %esi
popl %edx
popl %ecx
popl %ebx
ret
-END(readlink)
+END(mknodat)
diff --git a/libc/arch-x86/syscalls/readlink.S b/libc/arch-x86/syscalls/readlinkat.S
similarity index 65%
copy from libc/arch-x86/syscalls/readlink.S
copy to libc/arch-x86/syscalls/readlinkat.S
index 4a279dc..73b05af 100644
--- a/libc/arch-x86/syscalls/readlink.S
+++ b/libc/arch-x86/syscalls/readlinkat.S
@@ -4,14 +4,16 @@
#include <linux/err.h>
#include <machine/asm.h>
-ENTRY(readlink)
+ENTRY(readlinkat)
pushl %ebx
pushl %ecx
pushl %edx
- mov 16(%esp), %ebx
- mov 20(%esp), %ecx
- mov 24(%esp), %edx
- movl $__NR_readlink, %eax
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_readlinkat, %eax
int $0x80
cmpl $-MAX_ERRNO, %eax
jb 1f
@@ -21,8 +23,9 @@
addl $4, %esp
orl $-1, %eax
1:
+ popl %esi
popl %edx
popl %ecx
popl %ebx
ret
-END(readlink)
+END(readlinkat)
diff --git a/libc/arch-x86/syscalls/rename.S b/libc/arch-x86/syscalls/rename.S
deleted file mode 100644
index 8556619..0000000
--- a/libc/arch-x86/syscalls/rename.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(rename)
- pushl %ebx
- pushl %ecx
- mov 12(%esp), %ebx
- mov 16(%esp), %ecx
- movl $__NR_rename, %eax
- int $0x80
- cmpl $-MAX_ERRNO, %eax
- jb 1f
- negl %eax
- pushl %eax
- call __set_errno
- addl $4, %esp
- orl $-1, %eax
-1:
- popl %ecx
- popl %ebx
- ret
-END(rename)
diff --git a/libc/arch-x86/syscalls/rmdir.S b/libc/arch-x86/syscalls/rmdir.S
deleted file mode 100644
index 8ec2d3c..0000000
--- a/libc/arch-x86/syscalls/rmdir.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(rmdir)
- pushl %ebx
- mov 8(%esp), %ebx
- movl $__NR_rmdir, %eax
- int $0x80
- cmpl $-MAX_ERRNO, %eax
- jb 1f
- negl %eax
- pushl %eax
- call __set_errno
- addl $4, %esp
- orl $-1, %eax
-1:
- popl %ebx
- ret
-END(rmdir)
diff --git a/libc/arch-x86/syscalls/stat.S b/libc/arch-x86/syscalls/stat.S
deleted file mode 100644
index 6f7604d..0000000
--- a/libc/arch-x86/syscalls/stat.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(stat)
- pushl %ebx
- pushl %ecx
- mov 12(%esp), %ebx
- mov 16(%esp), %ecx
- movl $__NR_stat64, %eax
- int $0x80
- cmpl $-MAX_ERRNO, %eax
- jb 1f
- negl %eax
- pushl %eax
- call __set_errno
- addl $4, %esp
- orl $-1, %eax
-1:
- popl %ecx
- popl %ebx
- ret
-END(stat)
diff --git a/libc/arch-x86/syscalls/symlink.S b/libc/arch-x86/syscalls/symlink.S
deleted file mode 100644
index 815d833..0000000
--- a/libc/arch-x86/syscalls/symlink.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(symlink)
- pushl %ebx
- pushl %ecx
- mov 12(%esp), %ebx
- mov 16(%esp), %ecx
- movl $__NR_symlink, %eax
- int $0x80
- cmpl $-MAX_ERRNO, %eax
- jb 1f
- negl %eax
- pushl %eax
- call __set_errno
- addl $4, %esp
- orl $-1, %eax
-1:
- popl %ecx
- popl %ebx
- ret
-END(symlink)
diff --git a/libc/arch-x86/syscalls/readlink.S b/libc/arch-x86/syscalls/symlinkat.S
similarity index 87%
rename from libc/arch-x86/syscalls/readlink.S
rename to libc/arch-x86/syscalls/symlinkat.S
index 4a279dc..7d24226 100644
--- a/libc/arch-x86/syscalls/readlink.S
+++ b/libc/arch-x86/syscalls/symlinkat.S
@@ -4,14 +4,14 @@
#include <linux/err.h>
#include <machine/asm.h>
-ENTRY(readlink)
+ENTRY(symlinkat)
pushl %ebx
pushl %ecx
pushl %edx
mov 16(%esp), %ebx
mov 20(%esp), %ecx
mov 24(%esp), %edx
- movl $__NR_readlink, %eax
+ movl $__NR_symlinkat, %eax
int $0x80
cmpl $-MAX_ERRNO, %eax
jb 1f
@@ -25,4 +25,4 @@
popl %ecx
popl %ebx
ret
-END(readlink)
+END(symlinkat)
diff --git a/libc/arch-x86/syscalls/unlink.S b/libc/arch-x86/syscalls/unlink.S
deleted file mode 100644
index 297d34b..0000000
--- a/libc/arch-x86/syscalls/unlink.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(unlink)
- pushl %ebx
- mov 8(%esp), %ebx
- movl $__NR_unlink, %eax
- int $0x80
- cmpl $-MAX_ERRNO, %eax
- jb 1f
- negl %eax
- pushl %eax
- call __set_errno
- addl $4, %esp
- orl $-1, %eax
-1:
- popl %ebx
- ret
-END(unlink)
diff --git a/libc/arch-x86/syscalls/utimes.S b/libc/arch-x86/syscalls/utimes.S
deleted file mode 100644
index bfe02b5..0000000
--- a/libc/arch-x86/syscalls/utimes.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(utimes)
- pushl %ebx
- pushl %ecx
- mov 12(%esp), %ebx
- mov 16(%esp), %ecx
- movl $__NR_utimes, %eax
- int $0x80
- cmpl $-MAX_ERRNO, %eax
- jb 1f
- negl %eax
- pushl %eax
- call __set_errno
- addl $4, %esp
- orl $-1, %eax
-1:
- popl %ecx
- popl %ebx
- ret
-END(utimes)