diff options
author | ShadowNinja <shadowninja@minetest.net> | 2014-05-26 15:17:59 -0400 |
---|---|---|
committer | ShadowNinja <shadowninja@minetest.net> | 2014-05-26 15:20:06 -0400 |
commit | 31f9912e9e9f0d970725788af27f3a731415a57d (patch) | |
tree | a7eaf0fa5069965ca892508bfc054fc2fc517d28 | |
parent | 7fba341dbbffd21afa5476cd8bdf82b9d35cf83a (diff) | |
download | minetest-31f9912e9e9f0d970725788af27f3a731415a57d.tar.gz minetest-31f9912e9e9f0d970725788af27f3a731415a57d.tar.bz2 minetest-31f9912e9e9f0d970725788af27f3a731415a57d.zip |
Fix setThreadName support for BSD
-rw-r--r-- | src/porting.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/porting.h b/src/porting.h index 90bfa2502..937ca9464 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 <pthread.h> + #include <pthread_np.h> inline void setThreadName(const char *name) { pthread_set_name_np(pthread_self(), name); } +#elif defined(__NetBSD__) + #include <pthread.h> + + 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 |