From: ShadowNinja Date: Mon, 26 May 2014 19:17:59 +0000 (-0400) Subject: Fix setThreadName support for BSD X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=31f9912e9e9f0d970725788af27f3a731415a57d;p=zefram%2Fminetest%2Fminetest_engine.git Fix setThreadName support for BSD --- diff --git a/src/porting.h b/src/porting.h index 90bfa250..937ca946 100644 --- a/src/porting.h +++ b/src/porting.h @@ -285,12 +285,19 @@ inline u32 getTime(TimePrecision prec) */ prctl(PR_SET_NAME, name); } -#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#elif defined(__FreeBSD__) || defined(__OpenBSD__) #include + #include inline void setThreadName(const char *name) { pthread_set_name_np(pthread_self(), name); } +#elif defined(__NetBSD__) + #include + + inline void setThreadName(const char *name) { + pthread_setname_np(pthread_self(), name); + } #elif defined(_MSC_VER) typedef struct tagTHREADNAME_INFO { DWORD dwType; // must be 0x1000