mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
add set_threadname function
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/prctl.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
int cnxt_debug = 0; /* compat, unused */
|
||||
|
||||
@@ -76,3 +80,11 @@ void lt_debug_init(void)
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
void hal_set_threadname(const char *name)
|
||||
{
|
||||
char threadname[17];
|
||||
strncpy(threadname, name, sizeof(threadname));
|
||||
threadname[16] = 0;
|
||||
prctl (PR_SET_NAME, (unsigned long)&threadname);
|
||||
}
|
||||
|
@@ -23,6 +23,7 @@
|
||||
|
||||
extern int debuglevel;
|
||||
|
||||
void hal_set_threadname(const char *name);
|
||||
void _lt_debug(int facility, const void *, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
|
||||
void _lt_info(int facility, const void *, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
|
||||
void lt_debug_init(void);
|
||||
|
Reference in New Issue
Block a user