mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 08:51:04 +02:00
add system/set_threadname.h from git://gitorious.org/~martii/neutrino-mp/martiis-neutrino-mp.git
Origin commit data
------------------
Branch: ni/coolstream
Commit: 2d47ab2ecd
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2013-06-19 (Wed, 19 Jun 2013)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
14
src/system/set_threadname.h
Normal file
14
src/system/set_threadname.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#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, sizeof(threadname));
|
||||
threadname[16] = 0;
|
||||
prctl (PR_SET_NAME, (unsigned long)&threadname);
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user