diff options
author | Calin Juravle <calin@google.com> | 2014-03-10 18:10:04 +0000 |
---|---|---|
committer | Calin Juravle <calin@google.com> | 2014-03-11 10:44:36 +0000 |
commit | a4eafa6dbc98378f3fa759fec8590871e2b5ae29 (patch) | |
tree | 4b8a1a0a8c8070ae4845d9dfcaa88daab380ae68 | |
parent | 10f6beb3eb46cb2488427f58dccdd7bbfab5a250 (diff) | |
download | bionic-a4eafa6dbc98378f3fa759fec8590871e2b5ae29.zip bionic-a4eafa6dbc98378f3fa759fec8590871e2b5ae29.tar.gz bionic-a4eafa6dbc98378f3fa759fec8590871e2b5ae29.tar.bz2 |
Removed pthread_attr_getstackaddr/pthread_attr_setstackaddr
Moved existing definitions to ndk_cruft to preserve NDK compatibility.
Bug: 13281069
Change-Id: I6f260de69afa55a6274f0d13145c19ac6517b9d5
-rw-r--r-- | libc/bionic/ndk_cruft.cpp | 14 | ||||
-rw-r--r-- | libc/bionic/pthread_attr.cpp | 16 | ||||
-rw-r--r-- | libc/include/pthread.h | 4 |
3 files changed, 14 insertions, 20 deletions
diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp index b915382..b0346d4 100644 --- a/libc/bionic/ndk_cruft.cpp +++ b/libc/bionic/ndk_cruft.cpp @@ -29,6 +29,7 @@ // This file perpetuates the mistakes of the past, but only for 32-bit targets. #if !defined(__LP64__) +#include <pthread.h> #include <stdlib.h> #include <sys/resource.h> #include <sys/time.h> @@ -73,4 +74,17 @@ extern "C" void memswap(void* m1, void* m2, size_t n) { } } +extern "C" int pthread_attr_setstackaddr(pthread_attr_t*, void*) { + // This was removed from POSIX.1-2008, and is not implemented on bionic. + // Needed for ABI compatibility with the NDK. + return ENOSYS; +} + +extern "C" int pthread_attr_getstackaddr(const pthread_attr_t* attr, void** stack_addr) { + // This was removed from POSIX.1-2008. + // Needed for ABI compatibility with the NDK. + *stack_addr = (char*)attr->stack_base + attr->stack_size; + return 0; +} + #endif diff --git a/libc/bionic/pthread_attr.cpp b/libc/bionic/pthread_attr.cpp index d597c7e..e1cd853 100644 --- a/libc/bionic/pthread_attr.cpp +++ b/libc/bionic/pthread_attr.cpp @@ -94,22 +94,6 @@ int pthread_attr_getstacksize(const pthread_attr_t* attr, size_t* stack_size) { return 0; } -#if !defined(__LP64__) -// TODO: this exists only for backward binary compatibility on 32 bit platforms. -extern "C" int pthread_attr_setstackaddr(pthread_attr_t*, void*) { - // This was removed from POSIX.1-2008, and is not implemented on bionic. - // Needed for ABI compatibility with the NDK. - return ENOSYS; -} - -extern "C" int pthread_attr_getstackaddr(const pthread_attr_t* attr, void** stack_addr) { - // This was removed from POSIX.1-2008. - // Needed for ABI compatibility with the NDK. - *stack_addr = (char*)attr->stack_base + attr->stack_size; - return 0; -} -#endif // !defined(__LP64__) - int pthread_attr_setstack(pthread_attr_t* attr, void* stack_base, size_t stack_size) { if ((stack_size & (PAGE_SIZE - 1) || stack_size < PTHREAD_STACK_MIN)) { return EINVAL; diff --git a/libc/include/pthread.h b/libc/include/pthread.h index a2a6789..f93f9e9 100644 --- a/libc/include/pthread.h +++ b/libc/include/pthread.h @@ -234,10 +234,6 @@ extern void __pthread_cleanup_pop(__pthread_cleanup_t*, int); #if !defined(__LP64__) -/* Deprecated by POSIX. TODO: support for LP64 but add deprecated attribute instead? */ -int pthread_attr_getstackaddr(const pthread_attr_t*, void**) __nonnull((1, 2)); /* deprecated */ -int pthread_attr_setstackaddr(pthread_attr_t*, void*) __nonnull((1)); /* deprecated */ - // Bionic additions that are deprecated even in the 32-bit ABI. // // TODO: Remove them once chromium_org / NFC have switched over. |