diff options
author | Arne Coucheron <arco68@gmail.com> | 2016-10-27 09:47:10 +0200 |
---|---|---|
committer | Arne Coucheron <arco68@gmail.com> | 2016-10-27 20:13:17 +0200 |
commit | 6b9dac8b7f047fed67a608ae777877facf20f0fe (patch) | |
tree | 014be30c00191ca1cbc19671a74f54dc884fe26b | |
parent | 0d0b7a99e1baea5875467325829e0dafabb270b1 (diff) | |
download | android_bionic-cm-14.0.tar.gz android_bionic-cm-14.0.tar.bz2 android_bionic-cm-14.0.zip |
Revert "bionic: Registration of trapping calls during libc initialization"cm-14.0
* Breaks camera on some devices.
This reverts commit 0ca32a954f09c5eca1afd9b009389e10a88d3537.
Change-Id: Id8652cf0e35ecf1ff4bb00899e1342ce04ebc409
-rw-r--r-- | libc/Android.mk | 31 | ||||
-rw-r--r-- | libc/SYSCALLS.TXT | 10 | ||||
-rw-r--r-- | libc/arch-arm/syscalls/sendmsg.S (renamed from libc/arch-arm/syscalls/__sendmsg.S) | 4 | ||||
-rw-r--r-- | libc/arch-arm/syscalls/sendto.S (renamed from libc/arch-arm/syscalls/__sendto.S) | 4 | ||||
-rw-r--r-- | libc/arch-arm/syscalls/writev.S (renamed from libc/arch-arm/syscalls/__writev.S) | 4 | ||||
-rw-r--r-- | libc/arch-arm64/syscalls/sendmsg.S (renamed from libc/arch-arm64/syscalls/__sendmsg.S) | 5 | ||||
-rw-r--r-- | libc/arch-arm64/syscalls/sendto.S (renamed from libc/arch-arm64/syscalls/__sendto.S) | 5 | ||||
-rw-r--r-- | libc/arch-arm64/syscalls/writev.S (renamed from libc/arch-arm64/syscalls/__writev.S) | 5 | ||||
-rw-r--r-- | libc/arch-mips/syscalls/sendmsg.S (renamed from libc/arch-mips/syscalls/__sendmsg.S) | 4 | ||||
-rw-r--r-- | libc/arch-mips/syscalls/sendto.S (renamed from libc/arch-mips/syscalls/__sendto.S) | 4 | ||||
-rw-r--r-- | libc/arch-mips/syscalls/writev.S (renamed from libc/arch-mips/syscalls/__writev.S) | 4 | ||||
-rw-r--r-- | libc/arch-mips64/syscalls/sendmsg.S (renamed from libc/arch-mips64/syscalls/__sendmsg.S) | 5 | ||||
-rw-r--r-- | libc/arch-mips64/syscalls/sendto.S (renamed from libc/arch-mips64/syscalls/__sendto.S) | 5 | ||||
-rw-r--r-- | libc/arch-mips64/syscalls/writev.S (renamed from libc/arch-mips64/syscalls/__writev.S) | 5 | ||||
-rw-r--r-- | libc/arch-x86/syscalls/sendmsg.S (renamed from libc/arch-x86/syscalls/__sendmsg.S) | 4 | ||||
-rw-r--r-- | libc/arch-x86/syscalls/sendto.S (renamed from libc/arch-x86/syscalls/__sendto.S) | 4 | ||||
-rw-r--r-- | libc/arch-x86/syscalls/writev.S (renamed from libc/arch-x86/syscalls/__writev.S) | 4 | ||||
-rw-r--r-- | libc/arch-x86_64/syscalls/sendmsg.S (renamed from libc/arch-x86_64/syscalls/__sendmsg.S) | 5 | ||||
-rw-r--r-- | libc/arch-x86_64/syscalls/sendto.S (renamed from libc/arch-x86_64/syscalls/__sendto.S) | 5 | ||||
-rw-r--r-- | libc/arch-x86_64/syscalls/writev.S (renamed from libc/arch-x86_64/syscalls/__writev.S) | 5 | ||||
-rw-r--r-- | libc/bionic/close.cpp | 15 | ||||
-rw-r--r-- | libc/bionic/libc_init_dynamic.cpp | 10 | ||||
-rw-r--r-- | libc/bionic/sendmsg.cpp | 54 | ||||
-rw-r--r-- | libc/bionic/sendto.cpp | 53 | ||||
-rw-r--r-- | libc/bionic/writev.cpp | 44 | ||||
-rw-r--r-- | libc/codeaurora/PropClient.cpp | 108 | ||||
-rwxr-xr-x | libc/codeaurora/PropClientDispatch.cpp | 68 | ||||
-rwxr-xr-x | libc/codeaurora/PropClientDispatchWrite.cpp | 53 | ||||
-rwxr-xr-x | libc/include/codeaurora/PropClientDispatch.h | 51 | ||||
-rw-r--r-- | libc/include/codeaurora/PropClientDispatchWrite.h | 47 | ||||
-rw-r--r-- | libc/include/unistd.h | 11 | ||||
-rw-r--r-- | libc/libc.arm.map | 2 | ||||
-rw-r--r-- | libc/libc.arm64.map | 2 | ||||
-rw-r--r-- | libc/libc.map.txt | 2 |
34 files changed, 45 insertions, 597 deletions
diff --git a/libc/Android.mk b/libc/Android.mk index 34af6d224..94f7ce6cf 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -196,8 +196,6 @@ libc_bionic_ndk_src_files := \ bionic/sched_getcpu.cpp \ bionic/semaphore.cpp \ bionic/send.cpp \ - bionic/sendmsg.cpp \ - bionic/sendto.cpp \ bionic/setegid.cpp \ bionic/__set_errno.cpp \ bionic/seteuid.cpp \ @@ -243,11 +241,6 @@ libc_bionic_ndk_src_files := \ bionic/wchar.cpp \ bionic/wctype.cpp \ bionic/wmempcpy.cpp \ - bionic/writev.cpp \ - -libc_bionic_ndk_src_files += \ - codeaurora/PropClientDispatch.cpp \ - codeaurora/PropClientDispatchWrite.cpp libc_bionic_src_files := @@ -1025,12 +1018,6 @@ LOCAL_CFLAGS := $(libc_common_cflags) \ LOCAL_CONLYFLAGS := $(libc_common_conlyflags) LOCAL_CPPFLAGS := $(libc_common_cppflags) -Wold-style-cast - - -ifeq ($(BOARD_USES_LIBC_WRAPPER),true) -LOCAL_CPPFLAGS += -DUSE_WRAPPER -endif - LOCAL_C_INCLUDES := $(libc_common_c_includes) bionic/libstdc++/include LOCAL_MODULE := libc_bionic LOCAL_CLANG := $(use_clang) @@ -1056,19 +1043,10 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := $(libc_bionic_ndk_src_files) LOCAL_CFLAGS := $(libc_common_cflags) \ - -Wframe-larger-than=2048 - -ifeq ($(BOARD_USES_LIBC_WRAPPER),true) -LOCAL_CFLAGS += -DUSE_WRAPPER -endif + -Wframe-larger-than=2048 \ LOCAL_CONLYFLAGS := $(libc_common_conlyflags) -LOCAL_CPPFLAGS := $(libc_common_cppflags) -Wold-style-cast \ - -ifeq ($(BOARD_USES_LIBC_WRAPPER),true) -LOCAL_CPPFLAGS += -DUSE_WRAPPER -endif - +LOCAL_CPPFLAGS := $(libc_common_cppflags) -Wold-style-cast LOCAL_C_INCLUDES := $(libc_common_c_includes) bionic/libstdc++/include LOCAL_MODULE := libc_bionic_ndk LOCAL_CLANG := $(use_clang) @@ -1401,11 +1379,6 @@ LOCAL_SRC_FILES := \ bionic/NetdClient.cpp \ arch-common/bionic/crtend_so.S \ -ifeq ($(BOARD_USES_LIBC_WRAPPER),true) - LOCAL_SRC_FILES += codeaurora/PropClient.cpp - LOCAL_CPPFLAGS += -DUSE_WRAPPER -endif - LOCAL_MODULE := libc LOCAL_CLANG := $(use_clang) LOCAL_REQUIRED_MODULES := tzdata diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT index 08bee6362..d5dd2063e 100644 --- a/libc/SYSCALLS.TXT +++ b/libc/SYSCALLS.TXT @@ -118,7 +118,7 @@ int munlockall() all int mincore(void* start, size_t length, unsigned char* vec) all int __ioctl:ioctl(int, int, void*) all int readv(int, const struct iovec*, int) all -int __writev:writev(int, const struct iovec*, int) all +int writev(int, const struct iovec*, int) all int __fcntl64:fcntl64(int, int, void*) arm,mips,x86 int fcntl(int, int, void*) arm64,mips64,x86_64 int flock(int, int) all @@ -245,12 +245,12 @@ int listen(int, int) arm,arm64,mips,mips64,x86_64 int __accept4:accept4(int, struct sockaddr*, socklen_t*, int) arm,arm64,mips,mips64,x86_64 int getsockname(int, struct sockaddr*, socklen_t*) arm,arm64,mips,mips64,x86_64 int getpeername(int, struct sockaddr*, socklen_t*) arm,arm64,mips,mips64,x86_64 -int __sendto:sendto(int, const void*, size_t, int, const struct sockaddr*, socklen_t) arm,arm64,mips,mips64,x86_64 +int sendto(int, const void*, size_t, int, const struct sockaddr*, socklen_t) arm,arm64,mips,mips64,x86_64 int recvfrom(int, void*, size_t, unsigned int, struct sockaddr*, socklen_t*) arm,arm64,mips,mips64,x86_64 int shutdown(int, int) arm,arm64,mips,mips64,x86_64 int setsockopt(int, int, int, const void*, socklen_t) arm,arm64,mips,mips64,x86_64 int getsockopt(int, int, int, void*, socklen_t*) arm,arm64,mips,mips64,x86_64 -int __sendmsg:sendmsg(int, const struct msghdr*, unsigned int) arm,arm64,mips,mips64,x86_64 +int sendmsg(int, const struct msghdr*, unsigned int) arm,arm64,mips,mips64,x86_64 int recvmsg(int, struct msghdr*, unsigned int) arm,arm64,mips,mips64,x86_64 int recvmmsg(int, struct mmsghdr*, unsigned int, int, const struct timespec*) arm,arm64,mips,mips64,x86_64 int sendmmsg(int, struct mmsghdr*, unsigned int, int) arm,arm64,mips,mips64,x86_64 @@ -263,12 +263,12 @@ int listen:socketcall:4(int, int) x86 int getsockname:socketcall:6(int, struct sockaddr*, socklen_t*) x86 int getpeername:socketcall:7(int, struct sockaddr*, socklen_t*) x86 int socketpair:socketcall:8(int, int, int, int*) x86 -int __sendto:socketcall:11(int, const void*, size_t, int, const struct sockaddr*, socklen_t) x86 +int sendto:socketcall:11(int, const void*, size_t, int, const struct sockaddr*, socklen_t) x86 int recvfrom:socketcall:12(int, void*, size_t, unsigned int, struct sockaddr*, socklen_t*) x86 int shutdown:socketcall:13(int, int) x86 int setsockopt:socketcall:14(int, int, int, const void*, socklen_t) x86 int getsockopt:socketcall:15(int, int, int, void*, socklen_t*) x86 -int __sendmsg:socketcall:16(int, const struct msghdr*, unsigned int) x86 +int sendmsg:socketcall:16(int, const struct msghdr*, unsigned int) x86 int recvmsg:socketcall:17(int, struct msghdr*, unsigned int) x86 int __accept4:socketcall:18(int, struct sockaddr*, socklen_t*, int) x86 int recvmmsg:socketcall:19(int, struct mmsghdr*, unsigned int, int, const struct timespec*) x86 diff --git a/libc/arch-arm/syscalls/__sendmsg.S b/libc/arch-arm/syscalls/sendmsg.S index 6c63a6ca3..215219a76 100644 --- a/libc/arch-arm/syscalls/__sendmsg.S +++ b/libc/arch-arm/syscalls/sendmsg.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__sendmsg) +ENTRY(sendmsg) mov ip, r7 .cfi_register r7, ip ldr r7, =__NR_sendmsg @@ -13,4 +13,4 @@ ENTRY(__sendmsg) bxls lr neg r0, r0 b __set_errno_internal -END(__sendmsg) +END(sendmsg) diff --git a/libc/arch-arm/syscalls/__sendto.S b/libc/arch-arm/syscalls/sendto.S index b8cc40659..29b7b0bf6 100644 --- a/libc/arch-arm/syscalls/__sendto.S +++ b/libc/arch-arm/syscalls/sendto.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__sendto) +ENTRY(sendto) mov ip, sp stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 @@ -19,4 +19,4 @@ ENTRY(__sendto) bxls lr neg r0, r0 b __set_errno_internal -END(__sendto) +END(sendto) diff --git a/libc/arch-arm/syscalls/__writev.S b/libc/arch-arm/syscalls/writev.S index aa3d9bc3e..3103237b4 100644 --- a/libc/arch-arm/syscalls/__writev.S +++ b/libc/arch-arm/syscalls/writev.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__writev) +ENTRY(writev) mov ip, r7 .cfi_register r7, ip ldr r7, =__NR_writev @@ -13,4 +13,4 @@ ENTRY(__writev) bxls lr neg r0, r0 b __set_errno_internal -END(__writev) +END(writev) diff --git a/libc/arch-arm64/syscalls/__sendmsg.S b/libc/arch-arm64/syscalls/sendmsg.S index 50934c5c8..a34354360 100644 --- a/libc/arch-arm64/syscalls/__sendmsg.S +++ b/libc/arch-arm64/syscalls/sendmsg.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__sendmsg) +ENTRY(sendmsg) mov x8, __NR_sendmsg svc #0 @@ -11,5 +11,4 @@ ENTRY(__sendmsg) b.hi __set_errno_internal ret -END(__sendmsg) -.hidden __sendmsg +END(sendmsg) diff --git a/libc/arch-arm64/syscalls/__sendto.S b/libc/arch-arm64/syscalls/sendto.S index f74554670..6a6813e54 100644 --- a/libc/arch-arm64/syscalls/__sendto.S +++ b/libc/arch-arm64/syscalls/sendto.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__sendto) +ENTRY(sendto) mov x8, __NR_sendto svc #0 @@ -11,5 +11,4 @@ ENTRY(__sendto) b.hi __set_errno_internal ret -END(__sendto) -.hidden __sendto +END(sendto) diff --git a/libc/arch-arm64/syscalls/__writev.S b/libc/arch-arm64/syscalls/writev.S index fcce9f095..baaffda62 100644 --- a/libc/arch-arm64/syscalls/__writev.S +++ b/libc/arch-arm64/syscalls/writev.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__writev) +ENTRY(writev) mov x8, __NR_writev svc #0 @@ -11,5 +11,4 @@ ENTRY(__writev) b.hi __set_errno_internal ret -END(__writev) -.hidden __writev +END(writev) diff --git a/libc/arch-mips/syscalls/__sendmsg.S b/libc/arch-mips/syscalls/sendmsg.S index 8bc78003f..88c653e78 100644 --- a/libc/arch-mips/syscalls/__sendmsg.S +++ b/libc/arch-mips/syscalls/sendmsg.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__sendmsg) +ENTRY(sendmsg) .set noreorder .cpload t9 li v0, __NR_sendmsg @@ -16,4 +16,4 @@ ENTRY(__sendmsg) j t9 nop .set reorder -END(__sendmsg) +END(sendmsg) diff --git a/libc/arch-mips/syscalls/__sendto.S b/libc/arch-mips/syscalls/sendto.S index b0d60ab73..ef3fa9f71 100644 --- a/libc/arch-mips/syscalls/__sendto.S +++ b/libc/arch-mips/syscalls/sendto.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__sendto) +ENTRY(sendto) .set noreorder .cpload t9 li v0, __NR_sendto @@ -16,4 +16,4 @@ ENTRY(__sendto) j t9 nop .set reorder -END(__sendto) +END(sendto) diff --git a/libc/arch-mips/syscalls/__writev.S b/libc/arch-mips/syscalls/writev.S index 582dd1e80..d8d661659 100644 --- a/libc/arch-mips/syscalls/__writev.S +++ b/libc/arch-mips/syscalls/writev.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__writev) +ENTRY(writev) .set noreorder .cpload t9 li v0, __NR_writev @@ -16,4 +16,4 @@ ENTRY(__writev) j t9 nop .set reorder -END(__writev) +END(writev) diff --git a/libc/arch-mips64/syscalls/__sendmsg.S b/libc/arch-mips64/syscalls/sendmsg.S index df2078d1a..519dce41d 100644 --- a/libc/arch-mips64/syscalls/__sendmsg.S +++ b/libc/arch-mips64/syscalls/sendmsg.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__sendmsg) +ENTRY(sendmsg) .set push .set noreorder li v0, __NR_sendmsg @@ -22,5 +22,4 @@ ENTRY(__sendmsg) j t9 move ra, t0 .set pop -END(__sendmsg) -.hidden __sendmsg +END(sendmsg) diff --git a/libc/arch-mips64/syscalls/__sendto.S b/libc/arch-mips64/syscalls/sendto.S index 7253d212c..84efc0921 100644 --- a/libc/arch-mips64/syscalls/__sendto.S +++ b/libc/arch-mips64/syscalls/sendto.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__sendto) +ENTRY(sendto) .set push .set noreorder li v0, __NR_sendto @@ -22,5 +22,4 @@ ENTRY(__sendto) j t9 move ra, t0 .set pop -END(__sendto) -.hidden __sendto +END(sendto) diff --git a/libc/arch-mips64/syscalls/__writev.S b/libc/arch-mips64/syscalls/writev.S index fd3dddc25..d103d7179 100644 --- a/libc/arch-mips64/syscalls/__writev.S +++ b/libc/arch-mips64/syscalls/writev.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__writev) +ENTRY(writev) .set push .set noreorder li v0, __NR_writev @@ -22,5 +22,4 @@ ENTRY(__writev) j t9 move ra, t0 .set pop -END(__writev) -.hidden __writev +END(writev) diff --git a/libc/arch-x86/syscalls/__sendmsg.S b/libc/arch-x86/syscalls/sendmsg.S index 9c518c416..775ebeef3 100644 --- a/libc/arch-x86/syscalls/__sendmsg.S +++ b/libc/arch-x86/syscalls/sendmsg.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__sendmsg) +ENTRY(sendmsg) pushl %ebx .cfi_def_cfa_offset 8 .cfi_rel_offset ebx, 0 @@ -32,4 +32,4 @@ ENTRY(__sendmsg) popl %ecx popl %ebx ret -END(__sendmsg) +END(sendmsg) diff --git a/libc/arch-x86/syscalls/__sendto.S b/libc/arch-x86/syscalls/sendto.S index aae8fa42d..2df5e4f87 100644 --- a/libc/arch-x86/syscalls/__sendto.S +++ b/libc/arch-x86/syscalls/sendto.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__sendto) +ENTRY(sendto) pushl %ebx .cfi_def_cfa_offset 8 .cfi_rel_offset ebx, 0 @@ -32,4 +32,4 @@ ENTRY(__sendto) popl %ecx popl %ebx ret -END(__sendto) +END(sendto) diff --git a/libc/arch-x86/syscalls/__writev.S b/libc/arch-x86/syscalls/writev.S index d252fcae0..664990589 100644 --- a/libc/arch-x86/syscalls/__writev.S +++ b/libc/arch-x86/syscalls/writev.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__writev) +ENTRY(writev) pushl %ebx .cfi_def_cfa_offset 8 .cfi_rel_offset ebx, 0 @@ -36,4 +36,4 @@ ENTRY(__writev) popl %ecx popl %ebx ret -END(__writev) +END(writev) diff --git a/libc/arch-x86_64/syscalls/__sendmsg.S b/libc/arch-x86_64/syscalls/sendmsg.S index a6ff08759..84566b52c 100644 --- a/libc/arch-x86_64/syscalls/__sendmsg.S +++ b/libc/arch-x86_64/syscalls/sendmsg.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__sendmsg) +ENTRY(sendmsg) movl $__NR_sendmsg, %eax syscall cmpq $-MAX_ERRNO, %rax @@ -12,5 +12,4 @@ ENTRY(__sendmsg) call __set_errno_internal 1: ret -END(__sendmsg) -.hidden __sendmsg +END(sendmsg) diff --git a/libc/arch-x86_64/syscalls/__sendto.S b/libc/arch-x86_64/syscalls/sendto.S index 997448526..be3bace64 100644 --- a/libc/arch-x86_64/syscalls/__sendto.S +++ b/libc/arch-x86_64/syscalls/sendto.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__sendto) +ENTRY(sendto) movq %rcx, %r10 movl $__NR_sendto, %eax syscall @@ -13,5 +13,4 @@ ENTRY(__sendto) call __set_errno_internal 1: ret -END(__sendto) -.hidden __sendto +END(sendto) diff --git a/libc/arch-x86_64/syscalls/__writev.S b/libc/arch-x86_64/syscalls/writev.S index ed2dd61fb..8f8956f22 100644 --- a/libc/arch-x86_64/syscalls/__writev.S +++ b/libc/arch-x86_64/syscalls/writev.S @@ -2,7 +2,7 @@ #include <private/bionic_asm.h> -ENTRY(__writev) +ENTRY(writev) movl $__NR_writev, %eax syscall cmpq $-MAX_ERRNO, %rax @@ -12,5 +12,4 @@ ENTRY(__writev) call __set_errno_internal 1: ret -END(__writev) -.hidden __writev +END(writev) diff --git a/libc/bionic/close.cpp b/libc/bionic/close.cpp index 2d01965f6..18225f015 100644 --- a/libc/bionic/close.cpp +++ b/libc/bionic/close.cpp @@ -31,21 +31,8 @@ extern "C" int ___close(int); -#ifdef USE_WRAPPER -#include "codeaurora/PropClientDispatch.h" -#endif - int close(int fd) { - int rc; -#ifndef USE_WRAPPER - rc = ___close(fd); -#else - if ( __propClientDispatch.propClose ) { - rc = __propClientDispatch.propClose(fd); - } else { - rc = ___close(fd); - } -#endif + int rc = ___close(fd); if (rc == -1 && errno == EINTR) { // POSIX says that if close returns with EINTR, the fd must not be closed. // Linus disagrees: http://lkml.indiana.edu/hypermail/linux/kernel/0509.1/0877.html diff --git a/libc/bionic/libc_init_dynamic.cpp b/libc/bionic/libc_init_dynamic.cpp index e919d6147..ab48fb87f 100644 --- a/libc/bionic/libc_init_dynamic.cpp +++ b/libc/bionic/libc_init_dynamic.cpp @@ -57,11 +57,6 @@ extern "C" { extern void netdClientInit(void); - -#ifdef USE_WRAPPER - extern void propClientInit(void); -#endif - extern int __cxa_atexit(void (*)(void *), void *, void *); }; @@ -84,11 +79,6 @@ __attribute__((constructor)) static void __libc_preinit() { // Hooks for various libraries to let them know that we're starting up. __libc_globals.mutate(__libc_init_malloc); - -#ifdef USE_WRAPPER - propClientInit(); -#endif - netdClientInit(); } diff --git a/libc/bionic/sendmsg.cpp b/libc/bionic/sendmsg.cpp deleted file mode 100644 index d8a636b57..000000000 --- a/libc/bionic/sendmsg.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2016, The Linux Foundation. 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. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * 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> -#ifdef __i386__ -#define __socketcall __attribute__((__cdecl__)) -#else -#define __socketcall -#endif - - -extern "C" __socketcall int __sendmsg(int fd, const struct msghdr* msg, unsigned int flags); - -#ifdef USE_WRAPPER -#include "codeaurora/PropClientDispatchWrite.h" -#endif - - -extern "C" int sendmsg(int fd, const struct msghdr* msg, unsigned int flags) { -#ifndef USE_WRAPPER - return __sendmsg(fd, msg, flags); -#else - if( __propClientDispatchWrite.propSendmsg ) { - return __propClientDispatchWrite.propSendmsg(fd, msg, flags); - } else { - return __sendmsg(fd, msg, flags); - } -#endif -} diff --git a/libc/bionic/sendto.cpp b/libc/bionic/sendto.cpp deleted file mode 100644 index 50ffc4933..000000000 --- a/libc/bionic/sendto.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2016, The Linux Foundation. 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. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * 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. - */ - -#ifdef __i386__ -#define __socketcall __attribute__((__cdecl__)) -#else -#define __socketcall -#endif - -#include <unistd.h> -extern "C" __socketcall int __sendto(int, const void*, size_t, int, const struct sockaddr*, socklen_t); - -#ifdef USE_WRAPPER - #include "codeaurora/PropClientDispatchWrite.h" -#endif - -extern "C" int sendto(int fd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen) { -#ifndef USE_WRAPPER - return __sendto(fd, buf, len, flags, dest_addr,addrlen); -#else - if( __propClientDispatchWrite.propSendto ) { - return __propClientDispatchWrite.propSendto(fd, buf, len, flags, dest_addr,addrlen); - } else { - return __sendto(fd, buf, len, flags, dest_addr,addrlen); - } -#endif -} diff --git a/libc/bionic/writev.cpp b/libc/bionic/writev.cpp deleted file mode 100644 index 9e1c17413..000000000 --- a/libc/bionic/writev.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2016, The Linux Foundation. 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. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * 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> -extern "C" int __writev(int, const struct iovec*, int); -#ifdef USE_WRAPPER - #include "codeaurora/PropClientDispatchWrite.h" -#endif - -extern "C" int writev(int fd, const struct iovec* iov, int iovcnt) { - -#ifdef USE_WRAPPER - if( __propClientDispatchWrite.propWritev ) { - __propClientDispatchWrite.propWritev(fd); - } -#endif - return __writev(fd, iov, iovcnt); - -} diff --git a/libc/codeaurora/PropClient.cpp b/libc/codeaurora/PropClient.cpp deleted file mode 100644 index a9b0621d6..000000000 --- a/libc/codeaurora/PropClient.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2016, The Linux Foundation. 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. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * 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. - */ - -#ifndef _PROPCLIENT_H_ -#define _PROPCLIENT_H_ - -#ifdef LIBC_STATIC -#error PropClient.cpp should NOT be included in static libc builds. -#endif - -#include "private/libc_logging.h" -#include <dlfcn.h> -#include <pthread.h> -#include <stdlib.h> -#include <string.h> -#include "codeaurora/PropClientDispatch.h" -#include "codeaurora/PropClientDispatchWrite.h" - -static pthread_once_t propClientInitOnce = PTHREAD_ONCE_INIT; - -template <typename FunctionType> -static void propClientInitFunction(void* handle, const char* symbol, FunctionType* function) { - typedef void (*InitFunctionType)(FunctionType*); - InitFunctionType initFunction = reinterpret_cast<InitFunctionType>(dlsym(handle, symbol)); - if (initFunction != NULL) { - initFunction(function); - } -} - -static void propClientInitImpl() { - - void *propClientHandle = 0; - typedef bool (*VendorExtFunctionType)(); - bool vendorExtFlag = false; - propClientHandle = dlopen("libvendorconn.so", RTLD_NOW); - - if (propClientHandle != NULL) { - VendorExtFunctionType vendorExtFunction = reinterpret_cast<VendorExtFunctionType>(dlsym(propClientHandle, "isVendorExtAvailable")); - if( vendorExtFunction ) { - vendorExtFlag = vendorExtFunction(); - } - if( !vendorExtFlag || !vendorExtFunction ) { - dlclose(propClientHandle); - propClientHandle = NULL; - return; - } - } else { - // If the library is not available, it's not an error. We'll just use - // default implementations of functions that it would've overridden. - return; - } - - propClientInitFunction(propClientHandle, "propClientInitSocket", &__propClientDispatch.propSocket); - - propClientInitFunction(propClientHandle, "propClientInitConnect", &__propClientDispatch.propConnect); - - propClientInitFunction(propClientHandle, "propClientInitWrite", &__propClientDispatchWrite.propWrite); - - propClientInitFunction(propClientHandle, "propClientInitWritev", &__propClientDispatchWrite.propWritev); - - propClientInitFunction(propClientHandle, "propClientInitSendmsg", &__propClientDispatchWrite.propSendmsg); - - propClientInitFunction(propClientHandle, "propClientInitSendto", &__propClientDispatchWrite.propSendto); - - propClientInitFunction(propClientHandle, "propClientInitGetHostByNameForNet", &__propClientDispatch.propGetHostByNameForNet); - - propClientInitFunction(propClientHandle, "propClientInitGetHostByAddrForNet", &__propClientDispatch.propGetHostByAddrForNet); - - propClientInitFunction(propClientHandle, "propClientInitGetAddrInfoForNet", &__propClientDispatch.propGetAddrInfoForNet); - - propClientInitFunction(propClientHandle, "propClientInitSendDnsReport", &__propClientDispatch.propSendDnsReport); - - propClientInitFunction(propClientHandle, "propClientInitClose", &__propClientDispatch.propClose); -} - -extern "C" __LIBC_HIDDEN__ void propClientInit() { - if (pthread_once(&propClientInitOnce, propClientInitImpl)) { - __libc_format_log(ANDROID_LOG_ERROR, "propClient", "Failed to initialize prop_client"); - } -} - -#endif /* !_PROPCLIENT_H_ */ diff --git a/libc/codeaurora/PropClientDispatch.cpp b/libc/codeaurora/PropClientDispatch.cpp deleted file mode 100755 index 2891167db..000000000 --- a/libc/codeaurora/PropClientDispatch.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2016, The Linux Foundation. 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. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * 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 "codeaurora/PropClientDispatch.h" - -#ifdef __i386__ -#define __socketcall __attribute__((__cdecl__)) -#else -#define __socketcall -#endif - -int fallBackPropGetHostByNameForNet(const pid_t, const uid_t, const gid_t, const char*) { - return -1; -} - -int fallBackPropGetHostByAddrForNet(const pid_t, const uid_t, const gid_t, const void*) { - return -1; -} - -void fallBackPropSendDnsReport(const int) { - return; -} - -int fallBackPropGetAddrInfoForNet(const pid_t , const uid_t, const gid_t, const char*, const struct addrinfo *) { - return -1; -} - -extern "C" __socketcall int __socket(int, int, int); -extern "C" __socketcall int __connect(int, const sockaddr*, socklen_t); -extern "C" int ___close(int); - -// This structure is modified only at startup (when libc.so is loaded) and never -// afterwards, so it's okay that it's read later at runtime without a lock. -PropClientDispatch __propClientDispatch __attribute__((aligned(32))) = { - __socket, - __connect, - fallBackPropGetHostByNameForNet, - fallBackPropGetHostByAddrForNet, - fallBackPropGetAddrInfoForNet, - fallBackPropSendDnsReport, - ___close, -}; diff --git a/libc/codeaurora/PropClientDispatchWrite.cpp b/libc/codeaurora/PropClientDispatchWrite.cpp deleted file mode 100755 index 13e17bd25..000000000 --- a/libc/codeaurora/PropClientDispatchWrite.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2016, The Linux Foundation. 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. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * 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 "codeaurora/PropClientDispatchWrite.h" - -#ifdef __i386__ -#define __socketcall __attribute__((__cdecl__)) -#else -#define __socketcall -#endif - -void fallBackPropWrite(const int /*fd*/) { -} - -void fallBackPropWritev(const int /*fd*/) { -} - -extern "C" __socketcall int __sendmsg(int fd, const struct msghdr* msg, unsigned int flags); -extern "C" __socketcall int __sendto(int, const void*, size_t, int, const struct sockaddr*, socklen_t); - -// This structure is modified only at startup (when libc.so is loaded) and never -// afterwards, so it's okay that it's read later at runtime without a lock. -PropClientDispatchWrite __propClientDispatchWrite __attribute__((aligned(32))) = { - fallBackPropWrite, - fallBackPropWritev, - __sendmsg, - __sendto, -}; diff --git a/libc/include/codeaurora/PropClientDispatch.h b/libc/include/codeaurora/PropClientDispatch.h deleted file mode 100755 index 512cd6be3..000000000 --- a/libc/include/codeaurora/PropClientDispatch.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2016, The Linux Foundation. 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. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * 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. - */ -#ifndef PROP_CLIENT_DISPATCH_H -#define PROP_CLIENT_DISPATCH_H - -#include <sys/cdefs.h> -#include <sys/socket.h> - -__BEGIN_DECLS - -struct PropClientDispatch { - int (*propSocket)(int, int, int); - int (*propConnect)(int sockfd, const struct sockaddr* addr, socklen_t addrlen); - int (*propGetHostByNameForNet)(const pid_t pid, const uid_t, const gid_t, const char*); - int (*propGetHostByAddrForNet)(const pid_t pid, const uid_t, const gid_t, const void*); - int (*propGetAddrInfoForNet)(const pid_t pid, const uid_t, const gid_t, const char*, const struct addrinfo*); - void (*propSendDnsReport)(const int); - int (*propClose)(int); -}; - -extern struct PropClientDispatch __propClientDispatch; - -__END_DECLS - -#endif // PROP_CLIENT_DISPATCH_H diff --git a/libc/include/codeaurora/PropClientDispatchWrite.h b/libc/include/codeaurora/PropClientDispatchWrite.h deleted file mode 100644 index 58097a34c..000000000 --- a/libc/include/codeaurora/PropClientDispatchWrite.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2016, The Linux Foundation. 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. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * 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. - */ -#ifndef PROP_CLIENT_DISPATCH_WRITE_H -#define PROP_CLIENT_DISPATCH_WRITE_H - -#include <stdlib.h> -#include <sys/cdefs.h> -__BEGIN_DECLS -struct PropClientDispatchWrite { - - void (*propWrite)(const int fd); - void (*propWritev)(const int fd); - int (*propSendmsg)(int fd, const struct msghdr *msg, unsigned int flags); - int (*propSendto)(int fd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen); -}; - -extern struct PropClientDispatchWrite __propClientDispatchWrite; - -__END_DECLS - -#endif // PROP_CLIENT_DISPATCH_WRITE_H diff --git a/libc/include/unistd.h b/libc/include/unistd.h index 35adb9c2e..5045267a2 100644 --- a/libc/include/unistd.h +++ b/libc/include/unistd.h @@ -38,10 +38,6 @@ #include <bits/lockf.h> #include <bits/posix_limits.h> -#ifdef USE_WRAPPER -#include "codeaurora/PropClientDispatchWrite.h" -#endif - __BEGIN_DECLS #define STDIN_FILENO 0 @@ -81,6 +77,7 @@ __BEGIN_DECLS extern char** environ; extern __noreturn void _exit(int __status); + extern pid_t fork(void); extern pid_t vfork(void); extern pid_t getpid(void); @@ -469,12 +466,6 @@ __BIONIC_FORTIFY_INLINE ssize_t write(int fd, const void* buf, size_t count) { size_t bos = __bos0(buf); -#ifdef USE_WRAPPER - if( __propClientDispatchWrite.propWrite ) { - __propClientDispatchWrite.propWrite(fd); - } -#endif - #if !defined(__clang__) #if 0 /* work around a false positive due to a missed optimization */ if (__builtin_constant_p(count) && (count > SSIZE_MAX)) { diff --git a/libc/libc.arm.map b/libc/libc.arm.map index b7daff0c7..38f8437f4 100644 --- a/libc/libc.arm.map +++ b/libc/libc.arm.map @@ -119,8 +119,6 @@ LIBC { __pread64_chk; __pread_chk; __progname; - __propClientDispatch; #arm arm64 nobrillo - __propClientDispatchWrite; #arm arm64 nobrillo __pselect6; # arm x86 mips __pthread_cleanup_pop; __pthread_cleanup_push; diff --git a/libc/libc.arm64.map b/libc/libc.arm64.map index a07f4feaa..afbd0ee4b 100644 --- a/libc/libc.arm64.map +++ b/libc/libc.arm64.map @@ -77,8 +77,6 @@ LIBC { __pread64_chk; __pread_chk; __progname; - __propClientDispatch; #arm arm64 nobrillo - __propClientDispatchWrite; #arm arm64 nobrillo __pthread_cleanup_pop; __pthread_cleanup_push; __putlong; diff --git a/libc/libc.map.txt b/libc/libc.map.txt index fd9c2c68e..0e41f6ccb 100644 --- a/libc/libc.map.txt +++ b/libc/libc.map.txt @@ -119,8 +119,6 @@ LIBC { __pread64_chk; __pread_chk; __progname; - __propClientDispatch; #arm arm64 nobrillo - __propClientDispatchWrite; #arm arm64 nobrillo __pselect6; # arm x86 mips __pthread_cleanup_pop; __pthread_cleanup_push; |