diff options
Diffstat (limited to 'lib/util.c')
-rw-r--r-- | lib/util.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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 +} |