Files
neutrino/src/system/set_threadname.h
Stefan Seyfried b36c2b03d6 set_threadname: silence "overlapping src/dest" valgrind warning
This might be a false positive, but the fix does not harm ;)
2016-01-03 18:41:52 +01:00

15 lines
305 B
C

#ifndef __set_threadname_h__
#define __set_threadname_h__
#include <sys/types.h>
#include <sys/prctl.h>
#include <string.h>
inline void set_threadname(const char *name)
{
char threadname[17];
strncpy(threadname, name, 16);
threadname[16] = 0;
prctl (PR_SET_NAME, (unsigned long)threadname);
}
#endif