util: Avoid pthread_setaffinity_np on NetBSD

NetBSD's variant has a different prototype from the Linux version
the code expects. It might make sense to add support for NetBSD's
version, however, since NetBSD defaults to not allowing non-root
users to set processor affinity, there would be little gain here.

This is a build fix for NetBSD.

Signed-off-by: Nia Alarie <nia@NetBSD.org>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
CC: 20.3 <mesa-stable@lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7947>
(cherry picked from commit 275079e3ad)
This commit is contained in:
nia 2020-12-06 14:47:53 +01:00 committed by Dylan Baker
parent 76ecdf2c32
commit bbb85a7be0
2 changed files with 2 additions and 2 deletions

View file

@ -1381,7 +1381,7 @@
"description": "util: Avoid pthread_setaffinity_np on NetBSD",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": null
},

View file

@ -1354,7 +1354,7 @@ endif
dep_thread = dependency('threads')
if dep_thread.found() and host_machine.system() != 'windows'
pre_args += '-DHAVE_PTHREAD'
if cc.has_function(
if host_machine.system() != 'netbsd' and cc.has_function(
'pthread_setaffinity_np',
dependencies : dep_thread,
prefix : '#include <pthread.h>',