diff options
Diffstat (limited to 'src/server/helper.c')
-rw-r--r-- | src/server/helper.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/server/helper.c b/src/server/helper.c index 477acef..40d22f0 100644 --- a/src/server/helper.c +++ b/src/server/helper.c @@ -1,9 +1,12 @@ #include "helper.h" #include <arpa/inet.h> #include <stdlib.h> -#include <sys/prctl.h> // For thread names #include <signal.h> +#ifdef HAVE_THREAD_NAMES +#include <sys/prctl.h> // For thread names +#endif + /** * Parse IPv4 or IPv6 address in string representation to a suitable format usable by the BSD socket library * !! Contents of 'string' might be modified by this function !! @@ -121,7 +124,10 @@ void setThreadName(const char *name) newName[15] = '\0'; name = newName; } +#ifdef HAVE_THREAD_NAMES prctl( PR_SET_NAME, (unsigned long)name, 0, 0, 0 ); +#endif + //TODO: On FreeBSD set threadname with pthread_setname_np } void blockNoncriticalSignals() |