From bc28372cecaa3762a84ce59daa623a08b68990f5 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 16 Jul 2024 00:19:56 -0400 Subject: [PATCH] pthread: Apply extern "C" to getname/setname. Necessary because we don't include gnu/pthread.h here. --- src/system/libroot/posix/pthread/pthread.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/system/libroot/posix/pthread/pthread.cpp b/src/system/libroot/posix/pthread/pthread.cpp index b28b0646d3..b97483f69b 100644 --- a/src/system/libroot/posix/pthread/pthread.cpp +++ b/src/system/libroot/posix/pthread/pthread.cpp @@ -1,4 +1,5 @@ /* + * Copyright 2024, Haiku, Inc. All rights reserved. * Copyright 2008-2009, Axel Dörfler, axeld@pinc-software.de. * Copyright 2006, Jérôme Duval. All rights reserved. * Distributed under the terms of the MIT License. @@ -318,7 +319,7 @@ pthread_setschedparam(pthread_t thread, int policy, // #pragma mark - extensions -int +extern "C" int pthread_getname_np(pthread_t thread, char* buffer, size_t length) { thread_info info; @@ -333,7 +334,7 @@ pthread_getname_np(pthread_t thread, char* buffer, size_t length) } -int +extern "C" int pthread_setname_np(pthread_t thread, const char* name) { status_t status = _kern_rename_thread(thread->id, name);