More NetBSD fixes, by Randrianasulu.

This commit is contained in:
OBattler
2024-11-20 01:36:29 +01:00
parent 2947e0fd89
commit e0ff6a1da7
3 changed files with 12 additions and 1 deletions

View File

@@ -804,12 +804,16 @@ plat_set_thread_name(void *thread, const char *name)
if (thread) /* Apple pthread can only set self's name */
return;
char truncated[64];
# elif defined(Q_OS_NETBSD)
char truncated[64];
# else
char truncated[16];
# endif
strncpy(truncated, name, sizeof(truncated) - 1);
# if defined(Q_OS_DARWIN)
pthread_setname_np(truncated);
# elif defined(Q_OS_NETBSD)
pthread_setname_np(thread ? *((pthread_t *) thread) : pthread_self(), truncated, "%s");
# elif defined(Q_OS_OPENBSD)
pthread_set_name_np(thread ? *((pthread_t *) thread) : pthread_self(), truncated);
# else