Removed pthread_attr_getstackaddr/pthread_attr_setstackaddr

Moved existing definitions to ndk_cruft to preserve NDK compatibility.

Bug: 13281069
Change-Id: I6f260de69afa55a6274f0d13145c19ac6517b9d5
This commit is contained in:
Calin Juravle
2014-03-10 18:10:04 +00:00
parent 10f6beb3eb
commit a4eafa6dbc
3 changed files with 14 additions and 20 deletions

View File

@@ -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;