diff options
| author | Robert Pluim | 2020-01-31 10:22:59 +0100 |
|---|---|---|
| committer | Robert Pluim | 2020-02-03 16:40:25 +0100 |
| commit | 831508422e26e6d88dd5d8960e2569c489604c85 (patch) | |
| tree | d1cb4f413b41c6e7ae570dda44bcfde1a991061d /src | |
| parent | f27187f963e9e36435b508e29256e048799e0ff2 (diff) | |
| download | emacs-831508422e26e6d88dd5d8960e2569c489604c85.tar.gz emacs-831508422e26e6d88dd5d8960e2569c489604c85.zip | |
Cater for 3-argument version of pthread_setname_np
Fixes Bug#39363.
* configure.ac: Add check for 3-argument version of
pthread_setname_np.
* src/systhread.c (sys_thread_set_name)
[HAVE_PTHREAD_SETNAME_NP_3ARG]: Call pthread_setname_np with
3 arguments.
Diffstat (limited to 'src')
| -rw-r--r-- | src/systhread.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/systhread.c b/src/systhread.c index c649ae853a3..0d600d6895e 100644 --- a/src/systhread.c +++ b/src/systhread.c | |||
| @@ -214,11 +214,13 @@ sys_thread_set_name (const char *name) | |||
| 214 | char p_name[TASK_COMM_LEN]; | 214 | char p_name[TASK_COMM_LEN]; |
| 215 | strncpy (p_name, name, TASK_COMM_LEN - 1); | 215 | strncpy (p_name, name, TASK_COMM_LEN - 1); |
| 216 | p_name[TASK_COMM_LEN - 1] = '\0'; | 216 | p_name[TASK_COMM_LEN - 1] = '\0'; |
| 217 | #ifdef HAVE_PTHREAD_SETNAME_NP_1ARG | 217 | # ifdef HAVE_PTHREAD_SETNAME_NP_1ARG |
| 218 | pthread_setname_np (p_name); | 218 | pthread_setname_np (p_name); |
| 219 | #else | 219 | # elif defined HAVE_PTHREAD_SETNAME_NP_3ARG |
| 220 | pthread_setname_np (pthread_self (), "%s", p_name); | ||
| 221 | # else | ||
| 220 | pthread_setname_np (pthread_self (), p_name); | 222 | pthread_setname_np (pthread_self (), p_name); |
| 221 | #endif | 223 | # endif |
| 222 | #endif | 224 | #endif |
| 223 | } | 225 | } |
| 224 | 226 | ||