util: Handle differences in pthread_setname_np
authorMatt Turner <mattst88@gmail.com>
Wed, 31 Jul 2019 21:44:39 +0000 (14:44 -0700)
committerEric Engestrom <eric.engestrom@intel.com>
Fri, 2 Aug 2019 17:38:52 +0000 (18:38 +0100)
commitdcf9d91a80ee76f46e162afef9bd1b2ddb53ecc3
tree8a8a9fb991fecce1f5f65c57031b9a0c566ca7e3
parent55eadf971ade0189e905b5157e59cca91802fba7
util: Handle differences in pthread_setname_np

There are a lot of unfortunate differences in the implementation of this
function. NetBSD and Mac OS X in particular require different arguments.

https://stackoverflow.com/questions/2369738/how-to-set-the-name-of-a-thread-in-linux-pthreads/7989973#7989973
provides for a good overview of the differences.

Fixes: 9c411e020d1 ("util: Drop preprocessor guards for glibc-2.12")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111264
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
[Eric: use DETECT_OS_* instead of PIPE_OS_*]
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/util/u_thread.h