diff options
Diffstat (limited to 'libc/bionic/pthread_attr.cpp')
-rw-r--r-- | libc/bionic/pthread_attr.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/libc/bionic/pthread_attr.cpp b/libc/bionic/pthread_attr.cpp index dfb740d..fdf2965 100644 --- a/libc/bionic/pthread_attr.cpp +++ b/libc/bionic/pthread_attr.cpp @@ -56,7 +56,7 @@ int pthread_attr_setdetachstate(pthread_attr_t* attr, int state) { return 0; } -int pthread_attr_getdetachstate(pthread_attr_t const* attr, int* state) { +int pthread_attr_getdetachstate(const pthread_attr_t* attr, int* state) { *state = (attr->flags & PTHREAD_ATTR_FLAG_DETACHED) ? PTHREAD_CREATE_DETACHED : PTHREAD_CREATE_JOINABLE; return 0; } @@ -66,17 +66,17 @@ int pthread_attr_setschedpolicy(pthread_attr_t* attr, int policy) { return 0; } -int pthread_attr_getschedpolicy(pthread_attr_t const* attr, int* policy) { +int pthread_attr_getschedpolicy(const pthread_attr_t* attr, int* policy) { *policy = attr->sched_policy; return 0; } -int pthread_attr_setschedparam(pthread_attr_t * attr, struct sched_param const* param) { +int pthread_attr_setschedparam(pthread_attr_t* attr, const sched_param* param) { attr->sched_priority = param->sched_priority; return 0; } -int pthread_attr_getschedparam(pthread_attr_t const* attr, struct sched_param* param) { +int pthread_attr_getschedparam(const pthread_attr_t* attr, sched_param* param) { param->sched_priority = attr->sched_priority; return 0; } @@ -89,7 +89,7 @@ int pthread_attr_setstacksize(pthread_attr_t* attr, size_t stack_size) { return 0; } -int pthread_attr_getstacksize(pthread_attr_t const* attr, size_t* stack_size) { +int pthread_attr_getstacksize(const pthread_attr_t* attr, size_t* stack_size) { *stack_size = attr->stack_size; return 0; } @@ -100,7 +100,7 @@ int pthread_attr_setstackaddr(pthread_attr_t*, void*) { return ENOSYS; } -int pthread_attr_getstackaddr(pthread_attr_t const* attr, void** stack_addr) { +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; @@ -119,7 +119,7 @@ int pthread_attr_setstack(pthread_attr_t* attr, void* stack_base, size_t stack_s return 0; } -int pthread_attr_getstack(pthread_attr_t const* attr, void** stack_base, size_t* stack_size) { +int pthread_attr_getstack(const pthread_attr_t* attr, void** stack_base, size_t* stack_size) { *stack_base = attr->stack_base; *stack_size = attr->stack_size; return 0; @@ -130,7 +130,7 @@ int pthread_attr_setguardsize(pthread_attr_t* attr, size_t guard_size) { return 0; } -int pthread_attr_getguardsize(pthread_attr_t const* attr, size_t* guard_size) { +int pthread_attr_getguardsize(const pthread_attr_t* attr, size_t* guard_size) { *guard_size = attr->guard_size; return 0; } @@ -141,7 +141,7 @@ int pthread_getattr_np(pthread_t thid, pthread_attr_t* attr) { return 0; } -int pthread_attr_setscope(pthread_attr_t* , int scope) { +int pthread_attr_setscope(pthread_attr_t*, int scope) { if (scope == PTHREAD_SCOPE_SYSTEM) { return 0; } @@ -151,6 +151,7 @@ int pthread_attr_setscope(pthread_attr_t* , int scope) { return EINVAL; } -int pthread_attr_getscope(pthread_attr_t const*) { - return PTHREAD_SCOPE_SYSTEM; +int pthread_attr_getscope(const pthread_attr_t*, int* scope) { + *scope = PTHREAD_SCOPE_SYSTEM; + return 0; } |