diff --git a/thpool.c b/thpool.c index 8bc782a..52163f7 100644 --- a/thpool.c +++ b/thpool.c @@ -25,6 +25,9 @@ #if defined(__linux__) #include #endif +#if defined(__FreeBSD__) || defined(__OpenBSD__) +#include +#endif #include "thpool.h" @@ -339,6 +342,8 @@ static void* thread_do(struct thread* thread_p){ prctl(PR_SET_NAME, thread_name); #elif defined(__APPLE__) && defined(__MACH__) pthread_setname_np(thread_name); +#elif defined(__FreeBSD__) || defined(__OpenBSD__) + pthread_set_name_np(thread_p->pthread, thread_name); #else err("thread_do(): pthread_setname_np is not supported on this system"); #endif