NetBSD build fix

apparently the signature of pthread_setname_np() is different than the one
documented in the Linux man page for it:
https://man7.org/linux/man-pages/man3/pthread_setname_np.3.html
https://man.netbsd.org/pthread_setname_np.3

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2020-11-14 17:57:19 +02:00
parent 1863cec279
commit 5ad718cb25

View file

@ -209,6 +209,8 @@ void *QThreadPrivate::start(void *arg)
objectName = thr->metaObject()->className();
#if defined(QT_HAVE_PRCTL)
::prctl(PR_SET_NAME, (unsigned long)objectName.toLocal8Bit().constData(), 0, 0, 0);
#elif defined(QT_HAVE_PTHREAD_SETNAME_NP) && defined(Q_OS_NETBSD)
pthread_setname_np(thr->d_func()->thread_id, objectName.toLocal8Bit().constData(), (char*)"%s");
#elif defined(QT_HAVE_PTHREAD_SETNAME_NP)
pthread_setname_np(thr->d_func()->thread_id, objectName.toLocal8Bit().constData());
#endif