am db7f8eb0
: am 97dc3309
: Merge "Remove dependencies on obsolete __ARCH_WANT_SYSCALL_NO_FLAGS syscalls."
* commit 'db7f8eb011db18c69ec872823906e5f9660deaf7': Remove dependencies on obsolete __ARCH_WANT_SYSCALL_NO_FLAGS syscalls.
This commit is contained in:
commit
623fcf1e98
@ -216,6 +216,8 @@ libc_bionic_src_files := \
|
||||
bionic/chmod.cpp \
|
||||
bionic/chown.cpp \
|
||||
bionic/dirent.cpp \
|
||||
bionic/dup2.cpp \
|
||||
bionic/epoll_create.cpp \
|
||||
bionic/__errno.cpp \
|
||||
bionic/eventfd_read.cpp \
|
||||
bionic/eventfd_write.cpp \
|
||||
@ -223,6 +225,7 @@ libc_bionic_src_files := \
|
||||
bionic/futimens.cpp \
|
||||
bionic/getauxval.cpp \
|
||||
bionic/getcwd.cpp \
|
||||
bionic/inotify_init.cpp \
|
||||
bionic/lchown.cpp \
|
||||
bionic/libc_init_common.cpp \
|
||||
bionic/libc_logging.cpp \
|
||||
@ -233,6 +236,7 @@ libc_bionic_src_files := \
|
||||
bionic/mkfifo.cpp \
|
||||
bionic/mknod.cpp \
|
||||
bionic/open.cpp \
|
||||
bionic/pipe.cpp \
|
||||
bionic/pthread_attr.cpp \
|
||||
bionic/pthread_detach.cpp \
|
||||
bionic/pthread_equal.cpp \
|
||||
|
@ -124,9 +124,8 @@ int fcntl(int, void*) x86_64
|
||||
int flock(int, int) all
|
||||
int fchmod(int, mode_t) all
|
||||
int dup(int) all
|
||||
int pipe(int*) arm,x86,x86_64
|
||||
int pipe2(int*, int) all
|
||||
int dup2(int, int) all
|
||||
int dup3(int, int, int) all
|
||||
int select:_newselect(int, struct fd_set*, struct fd_set*, struct fd_set*, struct timeval*) arm,x86,mips
|
||||
int select(int, struct fd_set*, struct fd_set*, struct fd_set*, struct timeval*) x86_64
|
||||
int getdents:getdents64(unsigned int, struct dirent*, unsigned int) all
|
||||
@ -290,22 +289,20 @@ int sysinfo(struct sysinfo*) all
|
||||
int personality(unsigned long) all
|
||||
long perf_event_open(struct perf_event_attr* attr_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags) all
|
||||
|
||||
# futex
|
||||
int futex(void*, int, int, void*, void*, int) all
|
||||
int epoll_create1(int) all
|
||||
int epoll_ctl(int, int op, int, struct epoll_event*) all
|
||||
int epoll_wait(int, struct epoll_event*, int, int) all
|
||||
|
||||
# epoll
|
||||
int epoll_create(int size) all
|
||||
int epoll_ctl(int epfd, int op, int fd, struct epoll_event* event) all
|
||||
int epoll_wait(int epfd, struct epoll_event* events, int max, int timeout) all
|
||||
int eventfd:eventfd2(unsigned int, int) all
|
||||
|
||||
int inotify_init(void) all
|
||||
int inotify_add_watch(int, const char*, unsigned int) all
|
||||
int inotify_rm_watch(int, unsigned int) all
|
||||
int futex(void*, int, int, void*, void*, int) all
|
||||
|
||||
int inotify_init1(int) all
|
||||
int inotify_add_watch(int, const char*, unsigned int) all
|
||||
int inotify_rm_watch(int, unsigned int) all
|
||||
|
||||
int poll(struct pollfd*, unsigned int, long) all
|
||||
|
||||
int eventfd:eventfd2(unsigned int, int) all
|
||||
|
||||
# ARM-specific
|
||||
int __set_tls:__ARM_NR_set_tls(void*) arm
|
||||
int cacheflush:__ARM_NR_cacheflush(long start, long end, long flags) arm
|
||||
|
@ -50,8 +50,8 @@ syscall_src += arch-arm/syscalls/close.S
|
||||
syscall_src += arch-arm/syscalls/connect.S
|
||||
syscall_src += arch-arm/syscalls/delete_module.S
|
||||
syscall_src += arch-arm/syscalls/dup.S
|
||||
syscall_src += arch-arm/syscalls/dup2.S
|
||||
syscall_src += arch-arm/syscalls/epoll_create.S
|
||||
syscall_src += arch-arm/syscalls/dup3.S
|
||||
syscall_src += arch-arm/syscalls/epoll_create1.S
|
||||
syscall_src += arch-arm/syscalls/epoll_ctl.S
|
||||
syscall_src += arch-arm/syscalls/epoll_wait.S
|
||||
syscall_src += arch-arm/syscalls/eventfd.S
|
||||
@ -97,7 +97,7 @@ syscall_src += arch-arm/syscalls/getuid.S
|
||||
syscall_src += arch-arm/syscalls/getxattr.S
|
||||
syscall_src += arch-arm/syscalls/init_module.S
|
||||
syscall_src += arch-arm/syscalls/inotify_add_watch.S
|
||||
syscall_src += arch-arm/syscalls/inotify_init.S
|
||||
syscall_src += arch-arm/syscalls/inotify_init1.S
|
||||
syscall_src += arch-arm/syscalls/inotify_rm_watch.S
|
||||
syscall_src += arch-arm/syscalls/ioprio_get.S
|
||||
syscall_src += arch-arm/syscalls/ioprio_set.S
|
||||
@ -127,7 +127,6 @@ syscall_src += arch-arm/syscalls/nanosleep.S
|
||||
syscall_src += arch-arm/syscalls/pause.S
|
||||
syscall_src += arch-arm/syscalls/perf_event_open.S
|
||||
syscall_src += arch-arm/syscalls/personality.S
|
||||
syscall_src += arch-arm/syscalls/pipe.S
|
||||
syscall_src += arch-arm/syscalls/pipe2.S
|
||||
syscall_src += arch-arm/syscalls/poll.S
|
||||
syscall_src += arch-arm/syscalls/prctl.S
|
||||
|
@ -4,13 +4,13 @@
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(dup2)
|
||||
ENTRY(dup3)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_dup2
|
||||
ldr r7, =__NR_dup3
|
||||
swi #0
|
||||
mov r7, ip
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(dup2)
|
||||
END(dup3)
|
@ -4,13 +4,13 @@
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(epoll_create)
|
||||
ENTRY(epoll_create1)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_epoll_create
|
||||
ldr r7, =__NR_epoll_create1
|
||||
swi #0
|
||||
mov r7, ip
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(epoll_create)
|
||||
END(epoll_create1)
|
@ -4,13 +4,13 @@
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(inotify_init)
|
||||
ENTRY(inotify_init1)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_inotify_init
|
||||
ldr r7, =__NR_inotify_init1
|
||||
swi #0
|
||||
mov r7, ip
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(inotify_init)
|
||||
END(inotify_init1)
|
@ -1,16 +0,0 @@
|
||||
/* Generated by gensyscalls.py. Do not edit. */
|
||||
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(pipe)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_pipe
|
||||
swi #0
|
||||
mov r7, ip
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(pipe)
|
@ -51,8 +51,8 @@ syscall_src += arch-mips/syscalls/close.S
|
||||
syscall_src += arch-mips/syscalls/connect.S
|
||||
syscall_src += arch-mips/syscalls/delete_module.S
|
||||
syscall_src += arch-mips/syscalls/dup.S
|
||||
syscall_src += arch-mips/syscalls/dup2.S
|
||||
syscall_src += arch-mips/syscalls/epoll_create.S
|
||||
syscall_src += arch-mips/syscalls/dup3.S
|
||||
syscall_src += arch-mips/syscalls/epoll_create1.S
|
||||
syscall_src += arch-mips/syscalls/epoll_ctl.S
|
||||
syscall_src += arch-mips/syscalls/epoll_wait.S
|
||||
syscall_src += arch-mips/syscalls/eventfd.S
|
||||
@ -98,7 +98,7 @@ syscall_src += arch-mips/syscalls/getuid.S
|
||||
syscall_src += arch-mips/syscalls/getxattr.S
|
||||
syscall_src += arch-mips/syscalls/init_module.S
|
||||
syscall_src += arch-mips/syscalls/inotify_add_watch.S
|
||||
syscall_src += arch-mips/syscalls/inotify_init.S
|
||||
syscall_src += arch-mips/syscalls/inotify_init1.S
|
||||
syscall_src += arch-mips/syscalls/inotify_rm_watch.S
|
||||
syscall_src += arch-mips/syscalls/ioprio_get.S
|
||||
syscall_src += arch-mips/syscalls/ioprio_set.S
|
||||
|
@ -2,14 +2,14 @@
|
||||
|
||||
#include <asm/unistd.h>
|
||||
.text
|
||||
.globl dup2
|
||||
.globl dup3
|
||||
.align 4
|
||||
.ent dup2
|
||||
.ent dup3
|
||||
|
||||
dup2:
|
||||
dup3:
|
||||
.set noreorder
|
||||
.cpload $t9
|
||||
li $v0, __NR_dup2
|
||||
li $v0, __NR_dup3
|
||||
syscall
|
||||
bnez $a3, 1f
|
||||
move $a0, $v0
|
||||
@ -20,4 +20,4 @@ dup2:
|
||||
j $t9
|
||||
nop
|
||||
.set reorder
|
||||
.end dup2
|
||||
.end dup3
|
@ -2,14 +2,14 @@
|
||||
|
||||
#include <asm/unistd.h>
|
||||
.text
|
||||
.globl epoll_create
|
||||
.globl epoll_create1
|
||||
.align 4
|
||||
.ent epoll_create
|
||||
.ent epoll_create1
|
||||
|
||||
epoll_create:
|
||||
epoll_create1:
|
||||
.set noreorder
|
||||
.cpload $t9
|
||||
li $v0, __NR_epoll_create
|
||||
li $v0, __NR_epoll_create1
|
||||
syscall
|
||||
bnez $a3, 1f
|
||||
move $a0, $v0
|
||||
@ -20,4 +20,4 @@ epoll_create:
|
||||
j $t9
|
||||
nop
|
||||
.set reorder
|
||||
.end epoll_create
|
||||
.end epoll_create1
|
@ -2,14 +2,14 @@
|
||||
|
||||
#include <asm/unistd.h>
|
||||
.text
|
||||
.globl inotify_init
|
||||
.globl inotify_init1
|
||||
.align 4
|
||||
.ent inotify_init
|
||||
.ent inotify_init1
|
||||
|
||||
inotify_init:
|
||||
inotify_init1:
|
||||
.set noreorder
|
||||
.cpload $t9
|
||||
li $v0, __NR_inotify_init
|
||||
li $v0, __NR_inotify_init1
|
||||
syscall
|
||||
bnez $a3, 1f
|
||||
move $a0, $v0
|
||||
@ -20,4 +20,4 @@ inotify_init:
|
||||
j $t9
|
||||
nop
|
||||
.set reorder
|
||||
.end inotify_init
|
||||
.end inotify_init1
|
@ -50,8 +50,8 @@ syscall_src += arch-x86/syscalls/close.S
|
||||
syscall_src += arch-x86/syscalls/connect.S
|
||||
syscall_src += arch-x86/syscalls/delete_module.S
|
||||
syscall_src += arch-x86/syscalls/dup.S
|
||||
syscall_src += arch-x86/syscalls/dup2.S
|
||||
syscall_src += arch-x86/syscalls/epoll_create.S
|
||||
syscall_src += arch-x86/syscalls/dup3.S
|
||||
syscall_src += arch-x86/syscalls/epoll_create1.S
|
||||
syscall_src += arch-x86/syscalls/epoll_ctl.S
|
||||
syscall_src += arch-x86/syscalls/epoll_wait.S
|
||||
syscall_src += arch-x86/syscalls/eventfd.S
|
||||
@ -97,7 +97,7 @@ syscall_src += arch-x86/syscalls/getuid.S
|
||||
syscall_src += arch-x86/syscalls/getxattr.S
|
||||
syscall_src += arch-x86/syscalls/init_module.S
|
||||
syscall_src += arch-x86/syscalls/inotify_add_watch.S
|
||||
syscall_src += arch-x86/syscalls/inotify_init.S
|
||||
syscall_src += arch-x86/syscalls/inotify_init1.S
|
||||
syscall_src += arch-x86/syscalls/inotify_rm_watch.S
|
||||
syscall_src += arch-x86/syscalls/ioprio_get.S
|
||||
syscall_src += arch-x86/syscalls/ioprio_set.S
|
||||
@ -128,7 +128,6 @@ syscall_src += arch-x86/syscalls/nanosleep.S
|
||||
syscall_src += arch-x86/syscalls/pause.S
|
||||
syscall_src += arch-x86/syscalls/perf_event_open.S
|
||||
syscall_src += arch-x86/syscalls/personality.S
|
||||
syscall_src += arch-x86/syscalls/pipe.S
|
||||
syscall_src += arch-x86/syscalls/pipe2.S
|
||||
syscall_src += arch-x86/syscalls/poll.S
|
||||
syscall_src += arch-x86/syscalls/prctl.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 @@ ENTRY(dup2)
|
||||
addl $4, %esp
|
||||
orl $-1, %eax
|
||||
1:
|
||||
popl %edx
|
||||
popl %ecx
|
||||
popl %ebx
|
||||
ret
|
||||
END(dup2)
|
||||
END(dup3)
|
@ -4,10 +4,10 @@
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(epoll_create)
|
||||
ENTRY(epoll_create1)
|
||||
pushl %ebx
|
||||
mov 8(%esp), %ebx
|
||||
movl $__NR_epoll_create, %eax
|
||||
movl $__NR_epoll_create1, %eax
|
||||
int $0x80
|
||||
cmpl $-MAX_ERRNO, %eax
|
||||
jb 1f
|
||||
@ -19,4 +19,4 @@ ENTRY(epoll_create)
|
||||
1:
|
||||
popl %ebx
|
||||
ret
|
||||
END(epoll_create)
|
||||
END(epoll_create1)
|
@ -4,10 +4,10 @@
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(inotify_init)
|
||||
ENTRY(inotify_init1)
|
||||
pushl %ebx
|
||||
mov 8(%esp), %ebx
|
||||
movl $__NR_inotify_init, %eax
|
||||
movl $__NR_inotify_init1, %eax
|
||||
int $0x80
|
||||
cmpl $-MAX_ERRNO, %eax
|
||||
jb 1f
|
||||
@ -19,4 +19,4 @@ ENTRY(inotify_init)
|
||||
1:
|
||||
popl %ebx
|
||||
ret
|
||||
END(inotify_init)
|
||||
END(inotify_init1)
|
@ -1,22 +0,0 @@
|
||||
/* Generated by gensyscalls.py. Do not edit. */
|
||||
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(pipe)
|
||||
pushl %ebx
|
||||
mov 8(%esp), %ebx
|
||||
movl $__NR_pipe, %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(pipe)
|
@ -41,8 +41,8 @@ syscall_src += arch-x86_64/syscalls/close.S
|
||||
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/getuid.S
|
||||
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/nanosleep.S
|
||||
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
|
||||
|
@ -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 @@ ENTRY(dup2)
|
||||
orq $-1, %rax
|
||||
1:
|
||||
ret
|
||||
END(dup2)
|
||||
END(dup3)
|
@ -4,8 +4,8 @@
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(epoll_create)
|
||||
movl $__NR_epoll_create, %eax
|
||||
ENTRY(epoll_create1)
|
||||
movl $__NR_epoll_create1, %eax
|
||||
syscall
|
||||
cmpq $-MAX_ERRNO, %rax
|
||||
jb 1f
|
||||
@ -15,4 +15,4 @@ ENTRY(epoll_create)
|
||||
orq $-1, %rax
|
||||
1:
|
||||
ret
|
||||
END(epoll_create)
|
||||
END(epoll_create1)
|
@ -4,8 +4,8 @@
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(inotify_init)
|
||||
movl $__NR_inotify_init, %eax
|
||||
ENTRY(inotify_init1)
|
||||
movl $__NR_inotify_init1, %eax
|
||||
syscall
|
||||
cmpq $-MAX_ERRNO, %rax
|
||||
jb 1f
|
||||
@ -15,4 +15,4 @@ ENTRY(inotify_init)
|
||||
orq $-1, %rax
|
||||
1:
|
||||
ret
|
||||
END(inotify_init)
|
||||
END(inotify_init1)
|
@ -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)
|
33
libc/bionic/dup2.cpp
Normal file
33
libc/bionic/dup2.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
int dup2(int old_fd, int new_fd) {
|
||||
return dup3(old_fd, new_fd, 0);
|
||||
}
|
33
libc/bionic/epoll_create.cpp
Normal file
33
libc/bionic/epoll_create.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/epoll.h>
|
||||
|
||||
int epoll_create(int /*obsolete_size*/) {
|
||||
return epoll_create1(0);
|
||||
}
|
33
libc/bionic/inotify_init.cpp
Normal file
33
libc/bionic/inotify_init.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/inotify.h>
|
||||
|
||||
int inotify_init() {
|
||||
return inotify_init1(0);
|
||||
}
|
33
libc/bionic/pipe.cpp
Normal file
33
libc/bionic/pipe.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
int pipe(int pipefd[2]) {
|
||||
return pipe2(pipefd, 0);
|
||||
}
|
@ -29,6 +29,7 @@
|
||||
#define _SYS_EPOLL_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <asm/fcntl.h> /* For O_CLOEXEC. */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
@ -51,7 +52,9 @@ __BEGIN_DECLS
|
||||
#define EPOLL_CTL_DEL 2
|
||||
#define EPOLL_CTL_MOD 3
|
||||
|
||||
typedef union epoll_data
|
||||
#define EPOLL_CLOEXEC O_CLOEXEC
|
||||
|
||||
typedef union epoll_data
|
||||
{
|
||||
void *ptr;
|
||||
int fd;
|
||||
@ -59,17 +62,17 @@ typedef union epoll_data
|
||||
unsigned long long u64;
|
||||
} epoll_data_t;
|
||||
|
||||
struct epoll_event
|
||||
struct epoll_event
|
||||
{
|
||||
unsigned int events;
|
||||
epoll_data_t data;
|
||||
};
|
||||
|
||||
int epoll_create(int size);
|
||||
int epoll_create1(int flags);
|
||||
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);
|
||||
int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_EPOLL_H_ */
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_EVENTFD_H
|
||||
#define _SYS_EVENTFD_H
|
||||
|
||||
|
@ -29,14 +29,19 @@
|
||||
#define _SYS_INOTIFY_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <linux/inotify.h>
|
||||
#include <asm/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK. */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define IN_CLOEXEC O_CLOEXEC
|
||||
#define IN_NONBLOCK O_NONBLOCK
|
||||
|
||||
extern int inotify_init(void);
|
||||
extern int inotify_add_watch(int, const char *, __u32);
|
||||
extern int inotify_rm_watch(int, __u32);
|
||||
extern int inotify_init1(int);
|
||||
extern int inotify_add_watch(int, const char*, uint32_t);
|
||||
extern int inotify_rm_watch(int, uint32_t);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
@ -114,7 +114,7 @@ extern int chdir(const char *);
|
||||
extern int fchdir(int);
|
||||
extern int rmdir(const char *);
|
||||
extern int pipe(int *);
|
||||
#ifdef _GNU_SOURCE /* GLibc compatibility */
|
||||
#ifdef _GNU_SOURCE
|
||||
extern int pipe2(int *, int);
|
||||
#endif
|
||||
extern int chroot(const char *);
|
||||
@ -145,6 +145,9 @@ extern ssize_t pwrite64(int, const void *, size_t, off64_t);
|
||||
|
||||
extern int dup(int);
|
||||
extern int dup2(int, int);
|
||||
#ifdef _GNU_SOURCE
|
||||
extern int dup3(int, int, int);
|
||||
#endif
|
||||
extern int fcntl(int, int, ...);
|
||||
extern int ioctl(int, int, ...);
|
||||
extern int flock(int, int);
|
||||
|
Loading…
Reference in New Issue
Block a user