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_64/syscalls/__open.S b/libc/arch-x86_64/syscalls/__open.S
deleted file mode 100644
index a52235a..0000000
--- a/libc/arch-x86_64/syscalls/__open.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(__open)
-    movl    $__NR_open, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno
-    orq     $-1, %rax
-1:
-    ret
-END(__open)
diff --git a/libc/arch-x86_64/syscalls/access.S b/libc/arch-x86_64/syscalls/access.S
deleted file mode 100644
index 81fd734..0000000
--- a/libc/arch-x86_64/syscalls/access.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(access)
-    movl    $__NR_access, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno
-    orq     $-1, %rax
-1:
-    ret
-END(access)
diff --git a/libc/arch-x86_64/syscalls/chown.S b/libc/arch-x86_64/syscalls/chown.S
deleted file mode 100644
index a587c05..0000000
--- a/libc/arch-x86_64/syscalls/chown.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(chown)
-    movl    $__NR_chown, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno
-    orq     $-1, %rax
-1:
-    ret
-END(chown)
diff --git a/libc/arch-x86_64/syscalls/chmod.S b/libc/arch-x86_64/syscalls/fstatat.S
similarity index 76%
copy from libc/arch-x86_64/syscalls/chmod.S
copy to libc/arch-x86_64/syscalls/fstatat.S
index 4591f11..577660f 100644
--- a/libc/arch-x86_64/syscalls/chmod.S
+++ b/libc/arch-x86_64/syscalls/fstatat.S
@@ -4,8 +4,9 @@
 #include <linux/err.h>
 #include <machine/asm.h>
 
-ENTRY(chmod)
-    movl    $__NR_chmod, %eax
+ENTRY(fstatat)
+    movq    %rcx, %r10
+    movl    $__NR_newfstatat, %eax
     syscall
     cmpq    $-MAX_ERRNO, %rax
     jb      1f
@@ -15,4 +16,4 @@
     orq     $-1, %rax
 1:
     ret
-END(chmod)
+END(fstatat)
diff --git a/libc/arch-x86_64/syscalls/lchown.S b/libc/arch-x86_64/syscalls/lchown.S
deleted file mode 100644
index 2a90044..0000000
--- a/libc/arch-x86_64/syscalls/lchown.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(lchown)
-    movl    $__NR_lchown, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno
-    orq     $-1, %rax
-1:
-    ret
-END(lchown)
diff --git a/libc/arch-x86_64/syscalls/link.S b/libc/arch-x86_64/syscalls/link.S
deleted file mode 100644
index 8719572..0000000
--- a/libc/arch-x86_64/syscalls/link.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(link)
-    movl    $__NR_link, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno
-    orq     $-1, %rax
-1:
-    ret
-END(link)
diff --git a/libc/arch-x86_64/syscalls/chmod.S b/libc/arch-x86_64/syscalls/linkat.S
similarity index 77%
copy from libc/arch-x86_64/syscalls/chmod.S
copy to libc/arch-x86_64/syscalls/linkat.S
index 4591f11..8dced7d 100644
--- a/libc/arch-x86_64/syscalls/chmod.S
+++ b/libc/arch-x86_64/syscalls/linkat.S
@@ -4,8 +4,9 @@
 #include <linux/err.h>
 #include <machine/asm.h>
 
-ENTRY(chmod)
-    movl    $__NR_chmod, %eax
+ENTRY(linkat)
+    movq    %rcx, %r10
+    movl    $__NR_linkat, %eax
     syscall
     cmpq    $-MAX_ERRNO, %rax
     jb      1f
@@ -15,4 +16,4 @@
     orq     $-1, %rax
 1:
     ret
-END(chmod)
+END(linkat)
diff --git a/libc/arch-x86_64/syscalls/lstat.S b/libc/arch-x86_64/syscalls/lstat.S
deleted file mode 100644
index e68592d..0000000
--- a/libc/arch-x86_64/syscalls/lstat.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(lstat)
-    movl    $__NR_lstat, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno
-    orq     $-1, %rax
-1:
-    ret
-END(lstat)
diff --git a/libc/arch-x86_64/syscalls/mkdir.S b/libc/arch-x86_64/syscalls/mkdir.S
deleted file mode 100644
index d21b2e2..0000000
--- a/libc/arch-x86_64/syscalls/mkdir.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(mkdir)
-    movl    $__NR_mkdir, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno
-    orq     $-1, %rax
-1:
-    ret
-END(mkdir)
diff --git a/libc/arch-x86_64/syscalls/mknod.S b/libc/arch-x86_64/syscalls/mknod.S
deleted file mode 100644
index a49bc8a..0000000
--- a/libc/arch-x86_64/syscalls/mknod.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(mknod)
-    movl    $__NR_mknod, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno
-    orq     $-1, %rax
-1:
-    ret
-END(mknod)
diff --git a/libc/arch-x86_64/syscalls/chmod.S b/libc/arch-x86_64/syscalls/mknodat.S
similarity index 76%
copy from libc/arch-x86_64/syscalls/chmod.S
copy to libc/arch-x86_64/syscalls/mknodat.S
index 4591f11..92dbb5b 100644
--- a/libc/arch-x86_64/syscalls/chmod.S
+++ b/libc/arch-x86_64/syscalls/mknodat.S
@@ -4,8 +4,9 @@
 #include <linux/err.h>
 #include <machine/asm.h>
 
-ENTRY(chmod)
-    movl    $__NR_chmod, %eax
+ENTRY(mknodat)
+    movq    %rcx, %r10
+    movl    $__NR_mknodat, %eax
     syscall
     cmpq    $-MAX_ERRNO, %rax
     jb      1f
@@ -15,4 +16,4 @@
     orq     $-1, %rax
 1:
     ret
-END(chmod)
+END(mknodat)
diff --git a/libc/arch-x86_64/syscalls/readlink.S b/libc/arch-x86_64/syscalls/readlink.S
deleted file mode 100644
index 7cee437..0000000
--- a/libc/arch-x86_64/syscalls/readlink.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(readlink)
-    movl    $__NR_readlink, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno
-    orq     $-1, %rax
-1:
-    ret
-END(readlink)
diff --git a/libc/arch-x86_64/syscalls/chmod.S b/libc/arch-x86_64/syscalls/readlinkat.S
similarity index 74%
copy from libc/arch-x86_64/syscalls/chmod.S
copy to libc/arch-x86_64/syscalls/readlinkat.S
index 4591f11..209e4e9 100644
--- a/libc/arch-x86_64/syscalls/chmod.S
+++ b/libc/arch-x86_64/syscalls/readlinkat.S
@@ -4,8 +4,9 @@
 #include <linux/err.h>
 #include <machine/asm.h>
 
-ENTRY(chmod)
-    movl    $__NR_chmod, %eax
+ENTRY(readlinkat)
+    movq    %rcx, %r10
+    movl    $__NR_readlinkat, %eax
     syscall
     cmpq    $-MAX_ERRNO, %rax
     jb      1f
@@ -15,4 +16,4 @@
     orq     $-1, %rax
 1:
     ret
-END(chmod)
+END(readlinkat)
diff --git a/libc/arch-x86_64/syscalls/rename.S b/libc/arch-x86_64/syscalls/rename.S
deleted file mode 100644
index 2134732..0000000
--- a/libc/arch-x86_64/syscalls/rename.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(rename)
-    movl    $__NR_rename, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno
-    orq     $-1, %rax
-1:
-    ret
-END(rename)
diff --git a/libc/arch-x86_64/syscalls/rmdir.S b/libc/arch-x86_64/syscalls/rmdir.S
deleted file mode 100644
index ecfe558..0000000
--- a/libc/arch-x86_64/syscalls/rmdir.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(rmdir)
-    movl    $__NR_rmdir, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno
-    orq     $-1, %rax
-1:
-    ret
-END(rmdir)
diff --git a/libc/arch-x86_64/syscalls/stat.S b/libc/arch-x86_64/syscalls/stat.S
deleted file mode 100644
index c6e2c89..0000000
--- a/libc/arch-x86_64/syscalls/stat.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(stat)
-    movl    $__NR_stat, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno
-    orq     $-1, %rax
-1:
-    ret
-END(stat)
diff --git a/libc/arch-x86_64/syscalls/symlink.S b/libc/arch-x86_64/syscalls/symlink.S
deleted file mode 100644
index 0edb484..0000000
--- a/libc/arch-x86_64/syscalls/symlink.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(symlink)
-    movl    $__NR_symlink, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno
-    orq     $-1, %rax
-1:
-    ret
-END(symlink)
diff --git a/libc/arch-x86_64/syscalls/chmod.S b/libc/arch-x86_64/syscalls/symlinkat.S
similarity index 80%
rename from libc/arch-x86_64/syscalls/chmod.S
rename to libc/arch-x86_64/syscalls/symlinkat.S
index 4591f11..3da76f2 100644
--- a/libc/arch-x86_64/syscalls/chmod.S
+++ b/libc/arch-x86_64/syscalls/symlinkat.S
@@ -4,8 +4,8 @@
 #include <linux/err.h>
 #include <machine/asm.h>
 
-ENTRY(chmod)
-    movl    $__NR_chmod, %eax
+ENTRY(symlinkat)
+    movl    $__NR_symlinkat, %eax
     syscall
     cmpq    $-MAX_ERRNO, %rax
     jb      1f
@@ -15,4 +15,4 @@
     orq     $-1, %rax
 1:
     ret
-END(chmod)
+END(symlinkat)
diff --git a/libc/arch-x86_64/syscalls/unlink.S b/libc/arch-x86_64/syscalls/unlink.S
deleted file mode 100644
index 41fdc70..0000000
--- a/libc/arch-x86_64/syscalls/unlink.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(unlink)
-    movl    $__NR_unlink, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno
-    orq     $-1, %rax
-1:
-    ret
-END(unlink)
diff --git a/libc/arch-x86_64/syscalls/utimes.S b/libc/arch-x86_64/syscalls/utimes.S
deleted file mode 100644
index ff1fc6e..0000000
--- a/libc/arch-x86_64/syscalls/utimes.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <asm/unistd.h>
-#include <linux/err.h>
-#include <machine/asm.h>
-
-ENTRY(utimes)
-    movl    $__NR_utimes, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno
-    orq     $-1, %rax
-1:
-    ret
-END(utimes)