diff options
-rw-r--r-- | pr/src/pthreads/ptthread.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pr/src/pthreads/ptthread.c b/pr/src/pthreads/ptthread.c index e61a4cbd..0a3a9a7c 100644 --- a/pr/src/pthreads/ptthread.c +++ b/pr/src/pthreads/ptthread.c @@ -25,6 +25,10 @@ #include <pthread_np.h> #endif +#if defined(ANDROID) +#include <sys/prctl.h> +#endif + #ifdef SYMBIAN /* In Open C sched_get_priority_min/max do not work properly, so we undefine * _POSIX_THREAD_PRIORITY_SCHEDULING here. @@ -1633,6 +1637,8 @@ PR_IMPLEMENT(PRStatus) PR_SetCurrentThreadName(const char *name) #if defined(OPENBSD) || defined(FREEBSD) || defined(DRAGONFLY) pthread_set_name_np(thread->id, name); +#elif defined(ANDROID) + prctl(PR_SET_NAME, (unsigned long)(name)); #elif defined(NETBSD) result = pthread_setname_np(thread->id, "%s", (void *)name); #else /* not BSD */ |