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/syscalls/dup2.S b/libc/arch-x86/syscalls/dup3.S
similarity index 68%
rename from libc/arch-x86/syscalls/dup2.S
rename to libc/arch-x86/syscalls/dup3.S
index fee18f3..19522f0 100644
--- a/libc/arch-x86/syscalls/dup2.S
+++ b/libc/arch-x86/syscalls/dup3.S
@@ -4,12 +4,14 @@
#include <linux/err.h>
#include <machine/asm.h>
-ENTRY(dup2)
+ENTRY(dup3)
pushl %ebx
pushl %ecx
- mov 12(%esp), %ebx
- mov 16(%esp), %ecx
- movl $__NR_dup2, %eax
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_dup3, %eax
int $0x80
cmpl $-MAX_ERRNO, %eax
jb 1f
@@ -19,7 +21,8 @@
addl $4, %esp
orl $-1, %eax
1:
+ popl %edx
popl %ecx
popl %ebx
ret
-END(dup2)
+END(dup3)
diff --git a/libc/arch-x86/syscalls/epoll_create.S b/libc/arch-x86/syscalls/epoll_create.S
deleted file mode 100644
index 6c0c315..0000000
--- a/libc/arch-x86/syscalls/epoll_create.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(epoll_create)
- pushl %ebx
- mov 8(%esp), %ebx
- movl $__NR_epoll_create, %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(epoll_create)
diff --git a/libc/arch-x86/syscalls/pipe.S b/libc/arch-x86/syscalls/epoll_create1.S
similarity index 81%
rename from libc/arch-x86/syscalls/pipe.S
rename to libc/arch-x86/syscalls/epoll_create1.S
index 1d07efc..53e807b 100644
--- a/libc/arch-x86/syscalls/pipe.S
+++ b/libc/arch-x86/syscalls/epoll_create1.S
@@ -4,10 +4,10 @@
#include <linux/err.h>
#include <machine/asm.h>
-ENTRY(pipe)
+ENTRY(epoll_create1)
pushl %ebx
mov 8(%esp), %ebx
- movl $__NR_pipe, %eax
+ movl $__NR_epoll_create1, %eax
int $0x80
cmpl $-MAX_ERRNO, %eax
jb 1f
@@ -19,4 +19,4 @@
1:
popl %ebx
ret
-END(pipe)
+END(epoll_create1)
diff --git a/libc/arch-x86/syscalls/inotify_init.S b/libc/arch-x86/syscalls/inotify_init.S
deleted file mode 100644
index 21bdfa8..0000000
--- a/libc/arch-x86/syscalls/inotify_init.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(inotify_init)
- pushl %ebx
- mov 8(%esp), %ebx
- movl $__NR_inotify_init, %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(inotify_init)
diff --git a/libc/arch-x86/syscalls/pipe.S b/libc/arch-x86/syscalls/inotify_init1.S
similarity index 81%
copy from libc/arch-x86/syscalls/pipe.S
copy to libc/arch-x86/syscalls/inotify_init1.S
index 1d07efc..5ea3b8e 100644
--- a/libc/arch-x86/syscalls/pipe.S
+++ b/libc/arch-x86/syscalls/inotify_init1.S
@@ -4,10 +4,10 @@
#include <linux/err.h>
#include <machine/asm.h>
-ENTRY(pipe)
+ENTRY(inotify_init1)
pushl %ebx
mov 8(%esp), %ebx
- movl $__NR_pipe, %eax
+ movl $__NR_inotify_init1, %eax
int $0x80
cmpl $-MAX_ERRNO, %eax
jb 1f
@@ -19,4 +19,4 @@
1:
popl %ebx
ret
-END(pipe)
+END(inotify_init1)