Remove dependencies on obsolete __ARCH_WANT_SYSCALL_NO_FLAGS syscalls.
(aarch64 kernels only have the newer system calls.)
Also expose the new functionality that's exposed by glibc in our header files.
Change-Id: I45d2d168a03f88723d1f7fbf634701006a4843c5
diff --git a/libc/arch-x86_64/syscalls.mk b/libc/arch-x86_64/syscalls.mk
index 803b700..44ef729 100644
--- a/libc/arch-x86_64/syscalls.mk
+++ b/libc/arch-x86_64/syscalls.mk
@@ -41,8 +41,8 @@
syscall_src += arch-x86_64/syscalls/connect.S
syscall_src += arch-x86_64/syscalls/delete_module.S
syscall_src += arch-x86_64/syscalls/dup.S
-syscall_src += arch-x86_64/syscalls/dup2.S
-syscall_src += arch-x86_64/syscalls/epoll_create.S
+syscall_src += arch-x86_64/syscalls/dup3.S
+syscall_src += arch-x86_64/syscalls/epoll_create1.S
syscall_src += arch-x86_64/syscalls/epoll_ctl.S
syscall_src += arch-x86_64/syscalls/epoll_wait.S
syscall_src += arch-x86_64/syscalls/eventfd.S
@@ -89,7 +89,7 @@
syscall_src += arch-x86_64/syscalls/getxattr.S
syscall_src += arch-x86_64/syscalls/init_module.S
syscall_src += arch-x86_64/syscalls/inotify_add_watch.S
-syscall_src += arch-x86_64/syscalls/inotify_init.S
+syscall_src += arch-x86_64/syscalls/inotify_init1.S
syscall_src += arch-x86_64/syscalls/inotify_rm_watch.S
syscall_src += arch-x86_64/syscalls/ioprio_get.S
syscall_src += arch-x86_64/syscalls/ioprio_set.S
@@ -121,7 +121,6 @@
syscall_src += arch-x86_64/syscalls/pause.S
syscall_src += arch-x86_64/syscalls/perf_event_open.S
syscall_src += arch-x86_64/syscalls/personality.S
-syscall_src += arch-x86_64/syscalls/pipe.S
syscall_src += arch-x86_64/syscalls/pipe2.S
syscall_src += arch-x86_64/syscalls/poll.S
syscall_src += arch-x86_64/syscalls/prctl.S
diff --git a/libc/arch-x86_64/syscalls/dup2.S b/libc/arch-x86_64/syscalls/dup3.S
similarity index 84%
rename from libc/arch-x86_64/syscalls/dup2.S
rename to libc/arch-x86_64/syscalls/dup3.S
index e183e30..5878390 100644
--- a/libc/arch-x86_64/syscalls/dup2.S
+++ b/libc/arch-x86_64/syscalls/dup3.S
@@ -4,8 +4,8 @@
#include <linux/err.h>
#include <machine/asm.h>
-ENTRY(dup2)
- movl $__NR_dup2, %eax
+ENTRY(dup3)
+ movl $__NR_dup3, %eax
syscall
cmpq $-MAX_ERRNO, %rax
jb 1f
@@ -15,4 +15,4 @@
orq $-1, %rax
1:
ret
-END(dup2)
+END(dup3)
diff --git a/libc/arch-x86_64/syscalls/epoll_create.S b/libc/arch-x86_64/syscalls/epoll_create.S
deleted file mode 100644
index 7fbfd2b..0000000
--- a/libc/arch-x86_64/syscalls/epoll_create.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(epoll_create)
- movl $__NR_epoll_create, %eax
- syscall
- cmpq $-MAX_ERRNO, %rax
- jb 1f
- negl %eax
- movl %eax, %edi
- call __set_errno
- orq $-1, %rax
-1:
- ret
-END(epoll_create)
diff --git a/libc/arch-x86_64/syscalls/dup2.S b/libc/arch-x86_64/syscalls/epoll_create1.S
similarity index 77%
copy from libc/arch-x86_64/syscalls/dup2.S
copy to libc/arch-x86_64/syscalls/epoll_create1.S
index e183e30..7de8496 100644
--- a/libc/arch-x86_64/syscalls/dup2.S
+++ b/libc/arch-x86_64/syscalls/epoll_create1.S
@@ -4,8 +4,8 @@
#include <linux/err.h>
#include <machine/asm.h>
-ENTRY(dup2)
- movl $__NR_dup2, %eax
+ENTRY(epoll_create1)
+ movl $__NR_epoll_create1, %eax
syscall
cmpq $-MAX_ERRNO, %rax
jb 1f
@@ -15,4 +15,4 @@
orq $-1, %rax
1:
ret
-END(dup2)
+END(epoll_create1)
diff --git a/libc/arch-x86_64/syscalls/inotify_init.S b/libc/arch-x86_64/syscalls/inotify_init.S
deleted file mode 100644
index e456739..0000000
--- a/libc/arch-x86_64/syscalls/inotify_init.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(inotify_init)
- movl $__NR_inotify_init, %eax
- syscall
- cmpq $-MAX_ERRNO, %rax
- jb 1f
- negl %eax
- movl %eax, %edi
- call __set_errno
- orq $-1, %rax
-1:
- ret
-END(inotify_init)
diff --git a/libc/arch-x86_64/syscalls/dup2.S b/libc/arch-x86_64/syscalls/inotify_init1.S
similarity index 77%
copy from libc/arch-x86_64/syscalls/dup2.S
copy to libc/arch-x86_64/syscalls/inotify_init1.S
index e183e30..86a6d5f 100644
--- a/libc/arch-x86_64/syscalls/dup2.S
+++ b/libc/arch-x86_64/syscalls/inotify_init1.S
@@ -4,8 +4,8 @@
#include <linux/err.h>
#include <machine/asm.h>
-ENTRY(dup2)
- movl $__NR_dup2, %eax
+ENTRY(inotify_init1)
+ movl $__NR_inotify_init1, %eax
syscall
cmpq $-MAX_ERRNO, %rax
jb 1f
@@ -15,4 +15,4 @@
orq $-1, %rax
1:
ret
-END(dup2)
+END(inotify_init1)
diff --git a/libc/arch-x86_64/syscalls/pipe.S b/libc/arch-x86_64/syscalls/pipe.S
deleted file mode 100644
index e06932b..0000000
--- a/libc/arch-x86_64/syscalls/pipe.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(pipe)
- movl $__NR_pipe, %eax
- syscall
- cmpq $-MAX_ERRNO, %rax
- jb 1f
- negl %eax
- movl %eax, %edi
- call __set_errno
- orq $-1, %rax
-1:
- ret
-END(pipe)