summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2022-10-23 10:38:05 +0200
committerLinus Groh <mail@linusgroh.de>2022-10-24 15:49:39 +0200
commit1b13d52a872fa6c3ecb0bd26758e57715b712b44 (patch)
treefb90e85d52d4e5f366295b894cf8a732e0b2e827 /Userland
parentce4b66e9088532fa90710bf3bf2cf267a356788e (diff)
downloadserenity-1b13d52a872fa6c3ecb0bd26758e57715b712b44.zip
LibC: Make 'attributes' parameter for pthread_create const
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibC/pthread.cpp4
-rw-r--r--Userland/Libraries/LibC/pthread.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibC/pthread.cpp b/Userland/Libraries/LibC/pthread.cpp
index 3517e1c228..d47cd11e0d 100644
--- a/Userland/Libraries/LibC/pthread.cpp
+++ b/Userland/Libraries/LibC/pthread.cpp
@@ -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;
diff --git a/Userland/Libraries/LibC/pthread.h b/Userland/Libraries/LibC/pthread.h
index 2f7ff03c23..f5f76b6dfd 100644
--- a/Userland/Libraries/LibC/pthread.h
+++ b/Userland/Libraries/LibC/pthread.h
@@ -15,7 +15,7 @@
__BEGIN_DECLS
-int pthread_create(pthread_t*, pthread_attr_t*, void* (*)(void*), void*);
+int pthread_create(pthread_t*, pthread_attr_t const*, void* (*)(void*), void*);
void pthread_exit(void*) __attribute__((noreturn));
int pthread_kill(pthread_t, int);
void pthread_cleanup_push(void (*)(void*), void*);