aboutsummaryrefslogtreecommitdiffstats
path: root/lib/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util.c')
-rw-r--r--lib/util.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/util.c b/lib/util.c
index a529d38..00f1e1a 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -1,3 +1,12 @@
+
+#include "fuse_config.h"
+
+#ifdef HAVE_PTHREAD_SETNAME_NP
+#define _GNU_SOURCE
+#include <pthread.h>
+#endif
+
+#include <errno.h>
#include <stdlib.h>
#include <errno.h>
@@ -25,3 +34,13 @@ int libfuse_strtol(const char *str, long *res)
*res = val;
return 0;
}
+
+void fuse_set_thread_name(unsigned long tid, const char *name)
+{
+#ifdef HAVE_PTHREAD_SETNAME_NP
+ pthread_setname_np(tid, name);
+#else
+ (void)tid;
+ (void)name;
+#endif
+}