From 3ccf4f2c03ac5d3c4442f7dd5759e8d386f029c8 Mon Sep 17 00:00:00 2001 From: Andrew Hsieh Date: Tue, 26 Mar 2013 15:36:55 -0700 Subject: [PATCH] Deprecate __set_errno; Add #include in elf.h 1. __set_errno is deprecated and subject to removal in future release 2. elf.h is seen to be included alone, causing compilation error due to undefined uint32_t and uint64_t Change-Id: I4ca348a8ba0689eb3880622dcf5c53be470c57e8 --- .../android-3/arch-arm/symbols/libc.so.functions.txt | 1 - ndk/platforms/android-3/include/elf.h | 1 + ndk/platforms/android-3/include/errno.h | 12 ++++++++---- .../android-5/arch-arm/symbols/libc.so.functions.txt | 1 - .../android-8/arch-arm/symbols/libc.so.functions.txt | 1 - .../android-9/arch-arm/symbols/libc.so.functions.txt | 1 - .../arch-mips/symbols/libc.so.functions.txt | 1 - .../android-9/arch-x86/symbols/libc.so.functions.txt | 1 - 8 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ndk/platforms/android-3/arch-arm/symbols/libc.so.functions.txt b/ndk/platforms/android-3/arch-arm/symbols/libc.so.functions.txt index 814ce1916..4e4b92914 100644 --- a/ndk/platforms/android-3/arch-arm/symbols/libc.so.functions.txt +++ b/ndk/platforms/android-3/arch-arm/symbols/libc.so.functions.txt @@ -241,7 +241,6 @@ __rt_sigaction __rt_sigprocmask __rt_sigtimedwait __sclose -__set_errno __set_syscall_errno __set_tls __sflags diff --git a/ndk/platforms/android-3/include/elf.h b/ndk/platforms/android-3/include/elf.h index 4bc17a63b..cb8ffb77c 100644 --- a/ndk/platforms/android-3/include/elf.h +++ b/ndk/platforms/android-3/include/elf.h @@ -52,6 +52,7 @@ enum { AT_SECURE = 23 }; +#include #include typedef struct { diff --git a/ndk/platforms/android-3/include/errno.h b/ndk/platforms/android-3/include/errno.h index e1b15c04d..b97f6d2e3 100644 --- a/ndk/platforms/android-3/include/errno.h +++ b/ndk/platforms/android-3/include/errno.h @@ -40,16 +40,20 @@ __BEGIN_DECLS #define ENOTSUP EOPNOTSUPP #endif -/* internal function that should *only* be called from system calls */ -/* use errno = xxxx instead in C code */ -extern int __set_errno(int error); - /* internal function returning the address of the thread-specific errno */ extern volatile int* __errno(void); /* a macro expanding to the errno l-value */ #define errno (*__errno()) +/* internal function that should *only* be called from system calls */ +/* use errno = xxxx instead in C code */ +static __inline__ int __attribute__((deprecated)) +__set_errno(int n) { + errno = n; + return -1; +} + __END_DECLS #endif /* _ERRNO_H */ diff --git a/ndk/platforms/android-5/arch-arm/symbols/libc.so.functions.txt b/ndk/platforms/android-5/arch-arm/symbols/libc.so.functions.txt index 960850350..22616d40a 100644 --- a/ndk/platforms/android-5/arch-arm/symbols/libc.so.functions.txt +++ b/ndk/platforms/android-5/arch-arm/symbols/libc.so.functions.txt @@ -273,7 +273,6 @@ __rt_sigaction __rt_sigprocmask __rt_sigtimedwait __sclose -__set_errno __set_syscall_errno __set_tls __sflags diff --git a/ndk/platforms/android-8/arch-arm/symbols/libc.so.functions.txt b/ndk/platforms/android-8/arch-arm/symbols/libc.so.functions.txt index 88dd1b75b..917498f1d 100644 --- a/ndk/platforms/android-8/arch-arm/symbols/libc.so.functions.txt +++ b/ndk/platforms/android-8/arch-arm/symbols/libc.so.functions.txt @@ -284,7 +284,6 @@ __rt_sigaction __rt_sigprocmask __rt_sigtimedwait __sclose -__set_errno __set_syscall_errno __set_tls __setresuid diff --git a/ndk/platforms/android-9/arch-arm/symbols/libc.so.functions.txt b/ndk/platforms/android-9/arch-arm/symbols/libc.so.functions.txt index c1c435821..99eb2d430 100644 --- a/ndk/platforms/android-9/arch-arm/symbols/libc.so.functions.txt +++ b/ndk/platforms/android-9/arch-arm/symbols/libc.so.functions.txt @@ -288,7 +288,6 @@ __rt_sigaction __rt_sigprocmask __rt_sigtimedwait __sclose -__set_errno __set_syscall_errno __set_tls __setresuid diff --git a/ndk/platforms/android-9/arch-mips/symbols/libc.so.functions.txt b/ndk/platforms/android-9/arch-mips/symbols/libc.so.functions.txt index 1c72ae906..b8a95546a 100644 --- a/ndk/platforms/android-9/arch-mips/symbols/libc.so.functions.txt +++ b/ndk/platforms/android-9/arch-mips/symbols/libc.so.functions.txt @@ -159,7 +159,6 @@ __rt_sigaction __rt_sigprocmask __rt_sigtimedwait __sclose -__set_errno __set_syscall_errno __set_thread_area __set_tls diff --git a/ndk/platforms/android-9/arch-x86/symbols/libc.so.functions.txt b/ndk/platforms/android-9/arch-x86/symbols/libc.so.functions.txt index 60772cc79..2c7a608a2 100644 --- a/ndk/platforms/android-9/arch-x86/symbols/libc.so.functions.txt +++ b/ndk/platforms/android-9/arch-x86/symbols/libc.so.functions.txt @@ -155,7 +155,6 @@ __rt_sigaction __rt_sigprocmask __rt_sigtimedwait __sclose -__set_errno __set_syscall_errno __set_thread_area __set_tls