summaryrefslogtreecommitdiffstats
path: root/src/server/helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/helper.c')
-rw-r--r--src/server/helper.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/server/helper.c b/src/server/helper.c
index 24ee0fb..bc723e3 100644
--- a/src/server/helper.c
+++ b/src/server/helper.c
@@ -5,6 +5,7 @@
#include <fcntl.h>
#include <assert.h>
#include <sys/stat.h>
+#include <sys/prctl.h> // For thread names
#include "../types.h"
#include "../config.h"
@@ -172,3 +173,9 @@ int file_alloc(int fd, uint64_t offset, uint64_t size)
if ( write( fd, "", 1 ) != 1 ) return FALSE;
return TRUE;
}
+
+void setThreadName(char *name)
+{
+ if ( strlen( name ) > 16 ) name[16] = '\0';
+ prctl( PR_SET_NAME, (unsigned long)name, 0, 0, 0 );
+}