diff options
author | Yabin Cui <yabinc@google.com> | 2015-02-25 00:00:51 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-02-25 00:00:51 +0000 |
commit | 8c41eae6fcdb6cad1f6c46ae01708ead6b734060 (patch) | |
tree | 3fb9067c8790b6471ceadbdb80517731182aa7b8 | |
parent | af3ba5c87319e19c10be6755b37af92521f702c2 (diff) | |
parent | 7fb680bfda059746c9bb8939ffaed600eecc3a29 (diff) | |
download | android_bionic-8c41eae6fcdb6cad1f6c46ae01708ead6b734060.tar.gz android_bionic-8c41eae6fcdb6cad1f6c46ae01708ead6b734060.tar.bz2 android_bionic-8c41eae6fcdb6cad1f6c46ae01708ead6b734060.zip |
Merge "Move getusershell/endusershell/setusershell to ndk_cruft.cpp."
-rw-r--r-- | libc/bionic/ndk_cruft.cpp | 21 | ||||
-rw-r--r-- | libc/bionic/stubs.cpp | 13 | ||||
-rw-r--r-- | libc/include/unistd.h | 4 |
3 files changed, 18 insertions, 20 deletions
diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp index 77412aca6..ceff6a1db 100644 --- a/libc/bionic/ndk_cruft.cpp +++ b/libc/bionic/ndk_cruft.cpp @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -// This file perpetuates the mistakes of the past, but only for 32-bit targets. -#if !defined(__LP64__) +// This file perpetuates the mistakes of the past. #include <ctype.h> #include <dirent.h> @@ -46,6 +45,11 @@ #include <unistd.h> #include <wchar.h> +#include "private/libc_logging.h" + +// The part is only for 32-bit targets. +#if !defined(__LP64__) + // These were accidentally declared in <unistd.h> because we stupidly used to inline // getpagesize() and __getpageshift(). Needed for backwards compatibility with old NDK apps. extern "C" { @@ -342,4 +346,15 @@ extern "C" void* dlmalloc(size_t size) { return malloc(size); } -#endif +#endif // !defined(__LP64__) + +// This is never implemented in bionic, only needed for ABI compatibility with the NDK. +extern "C" char* getusershell() { + return NULL; +} + +// This is never implemented in bionic, only needed for ABI compatibility with the NDK. +extern "C" void setusershell() { } + +// This is never implemented in bionic, only needed for ABI compatibility with the NDK. +extern "C" void endusershell() { } diff --git a/libc/bionic/stubs.cpp b/libc/bionic/stubs.cpp index 1264fd7c1..c192bf83e 100644 --- a/libc/bionic/stubs.cpp +++ b/libc/bionic/stubs.cpp @@ -458,19 +458,6 @@ void endpwent() { UNIMPLEMENTED; } -char* getusershell() { - UNIMPLEMENTED; - return NULL; -} - -void setusershell() { - UNIMPLEMENTED; -} - -void endusershell() { - UNIMPLEMENTED; -} - // Portable code should use sysconf(_SC_PAGE_SIZE) directly instead. int getpagesize() { // We dont use sysconf(3) here because that drags in stdio, which makes static binaries fat. diff --git a/libc/include/unistd.h b/libc/include/unistd.h index a6d791c98..92d3abe3c 100644 --- a/libc/include/unistd.h +++ b/libc/include/unistd.h @@ -116,10 +116,6 @@ extern int setresgid(gid_t, gid_t, gid_t); extern int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); extern int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); extern char* getlogin(void); -extern char* getusershell(void); -extern void setusershell(void); -extern void endusershell(void); - extern long fpathconf(int, int); extern long pathconf(const char*, int); |