From efcca9d56c8d0a8dd3d94400136346134739fc1b Mon Sep 17 00:00:00 2001 From: leleliu008 Date: Mon, 2 Sep 2024 15:27:54 +0800 Subject: [PATCH] fix pthread_setname_np(3) wrong call (#1182) Reference: https://man.netbsd.org/pthread_setname_np.3 --- src/thread/thread.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/thread/thread.c b/src/thread/thread.c index c3e16af8e..281cb2fa7 100644 --- a/src/thread/thread.c +++ b/src/thread/thread.c @@ -94,6 +94,8 @@ static int handler(void *p) #elif defined(HAVE_PTHREAD) #if defined(OPENBSD) (void)pthread_set_name_np(*th.thr, th.name); +#elif defined(__NetBSD__) + (void)pthread_setname_np(*th.thr, "%s", th.name); #else (void)pthread_setname_np(*th.thr, th.name); #endif