summaryrefslogtreecommitdiffstats
path: root/src/server/helper.c
diff options
context:
space:
mode:
authorSebastian2016-02-10 21:53:15 +0100
committerSebastian2016-02-11 00:09:39 +0100
commit1ee67aedd55b452c7d5851d0e39e01aef4aca766 (patch)
treecaf482cd40463d5a4b15f14e5bd5b2d34bf936bd /src/server/helper.c
parentcleanup commits (diff)
downloaddnbd3-1ee67aedd55b452c7d5851d0e39e01aef4aca766.tar.gz
dnbd3-1ee67aedd55b452c7d5851d0e39e01aef4aca766.tar.xz
dnbd3-1ee67aedd55b452c7d5851d0e39e01aef4aca766.zip
dnbd3server build success on freebsd :)
Diffstat (limited to 'src/server/helper.c')
-rw-r--r--src/server/helper.c8
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()