Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2016-08-22 20:43:05 +0300
committerJon Turney <jon.turney@dronecode.org.uk>2016-08-23 17:07:42 +0300
commitfdb7df230ded019be0472565d79de14fe677dea7 (patch)
tree7035900f61662c0d2c5a6fc493b811f97293949b /winsup/cygwin/common.din
parentfb8e88815e89cc4bee5e514ca9a21c9771a31f1c (diff)
Add pthread_getname_np and pthread_setname_np
This patch adds pthread_getname_np and pthread_setname_np. These were added to glibc in 2.12[1] and are also present in some form on NetBSD and several UNIXes. The code is based on NetBSD's implementation with changes to better match Linux behaviour. Implementation quirks: * pthread_setname_np with a NULL pointer segfaults (as linux) * pthread_setname_np returns ERANGE for names longer than 16 characters (as linux) * pthread_getname_np with a NULL pointer returns EFAULT (as linux) * pthread_getname_np with a buffer length of less than 16 returns ERANGE (as linux) * pthread_getname_np truncates the thread name to fit the buffer length. This guarantees success even when the default thread name is longer than 16 characters, but means there is no way to discover the actual length of the thread name. (Linux always truncates the thread name to 16 characters) * Changing program_invocation_short_name changes the default thread name (on linux, it has no effect on the default thread name) I'll leave it up to you to decide if any of these matter. This is implemented via class pthread_attr to make it easier to add pthread_attr_[gs]etname_np (present in NetBSD and some UNIXes) should it ever be added to Linux (or we decide we want it anyway). [1] https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS
Diffstat (limited to 'winsup/cygwin/common.din')
-rw-r--r--winsup/cygwin/common.din2
1 files changed, 2 insertions, 0 deletions
diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din
index d54b70abb..8f7a282f4 100644
--- a/winsup/cygwin/common.din
+++ b/winsup/cygwin/common.din
@@ -1046,6 +1046,7 @@ pthread_exit SIGFE
pthread_getattr_np SIGFE
pthread_getconcurrency SIGFE
pthread_getcpuclockid SIGFE
+pthread_getname_np SIGFE
pthread_getschedparam SIGFE
pthread_getsequence_np SIGFE
pthread_getspecific SIGFE
@@ -1086,6 +1087,7 @@ pthread_self SIGFE
pthread_setcancelstate SIGFE
pthread_setcanceltype SIGFE
pthread_setconcurrency SIGFE
+pthread_setname_np SIGFE
pthread_setschedparam SIGFE
pthread_setschedprio SIGFE
pthread_setspecific SIGFE