1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

LibC: Make 'attributes' parameter for pthread_create const

This commit is contained in:
Gunnar Beutner 2022-10-23 10:38:05 +02:00 committed by Linus Groh
parent ce4b66e908
commit 1b13d52a87
2 changed files with 3 additions and 3 deletions

View file

@ -121,13 +121,13 @@ static int create_thread(pthread_t* thread, void* (*entry)(void*), void* argumen
}
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_create.html
int pthread_create(pthread_t* thread, pthread_attr_t* attributes, void* (*start_routine)(void*), void* argument_to_start_routine)
int pthread_create(pthread_t* thread, pthread_attr_t const* attributes, void* (*start_routine)(void*), void* argument_to_start_routine)
{
if (!thread)
return -EINVAL;
PthreadAttrImpl default_attributes {};
PthreadAttrImpl** arg_attributes = reinterpret_cast<PthreadAttrImpl**>(attributes);
PthreadAttrImpl* const* arg_attributes = reinterpret_cast<PthreadAttrImpl* const*>(attributes);
PthreadAttrImpl* used_attributes = arg_attributes ? *arg_attributes : &default_attributes;