diff options
author | Ulrich Drepper <drepper@redhat.com> | 2010-04-09 01:09:24 -0700 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2010-04-09 01:09:24 -0700 |
commit | 86a4c67fb91b82c7b47c115b88ab01b1a696f10f (patch) | |
tree | a0cc88b9d0e063153cf6c3aba1aed2cfdfa5a6a8 /nptl/sysdeps/pthread | |
parent | 80a18ba74d658d9216173b60382ef1c87aa1ae06 (diff) | |
download | glibc-86a4c67fb91b82c7b47c115b88ab01b1a696f10f.tar.gz glibc-86a4c67fb91b82c7b47c115b88ab01b1a696f10f.tar.xz glibc-86a4c67fb91b82c7b47c115b88ab01b1a696f10f.zip |
Implement interfaces to set and get names of threads.
At least the Linux kernel provides field where the kernel originally stores the command which is executed by the thread. The value can subsequently be overwritten. The added functions allow to do that for threads, providing and abstraction around the syscalls or /proc file system accesses needed.
Diffstat (limited to 'nptl/sysdeps/pthread')
-rw-r--r-- | nptl/sysdeps/pthread/pthread.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h index b84fd5c7a4..44cf9f0cac 100644 --- a/nptl/sysdeps/pthread/pthread.h +++ b/nptl/sysdeps/pthread/pthread.h @@ -425,6 +425,18 @@ extern int pthread_setschedprio (pthread_t __target_thread, int __prio) __THROW; +#ifdef __USE_GNU +/* Get thread name visible in the kernel and its interfaces. */ +extern int pthread_getname_np (pthread_t __target_thread, char *__buf, + size_t __buflen) + __THROW __nonnull ((2)); + +/* Set thread name visible in the kernel and its interfaces. */ +extern int pthread_setname_np (pthread_t __target_thread, __const char *__name) + __THROW __nonnull ((2)); +#endif + + #ifdef __USE_UNIX98 /* Determine level of concurrency. */ extern int pthread_getconcurrency (void) __THROW; |