Mesa (staging/20.3): util: Avoid pthread_setaffinity_np on NetBSD

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 13 00:04:28 UTC 2021


Module: Mesa
Branch: staging/20.3
Commit: bbb85a7be0061b4c71bc5cb9796f870dc47da10f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bbb85a7be0061b4c71bc5cb9796f870dc47da10f

Author: nia <nia at netbsd.org>
Date:   Sun Dec  6 14:47:53 2020 +0100

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 at NetBSD.org>
Reviewed-by: Dylan Baker <dylan at pnwbakers.com>
CC: 20.3 <mesa-stable at lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7947>
(cherry picked from commit 275079e3adc184ba3841222918e852c3e63f435f)

---

 .pick_status.json | 2 +-
 meson.build       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 343e5579015..8f0bd38d24c 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -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
     },
diff --git a/meson.build b/meson.build
index c2843a30766..9fc09a42d25 100644
--- a/meson.build
+++ b/meson.build
@@ -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>',



More information about the mesa-commit mailing list