Module: xenomai-2.6 Branch: master Commit: e379fc6dac2866cae9a71eed4044186682627b4d URL: http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=e379fc6dac2866cae9a71eed4044186682627b4d
Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org> Date: Tue May 15 00:52:04 2012 +0200 posix: get pthread_set_name_np to set linux thread name too --- ksrc/skins/posix/syscall.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/ksrc/skins/posix/syscall.c b/ksrc/skins/posix/syscall.c index 455e2e1..9f5d315 100644 --- a/ksrc/skins/posix/syscall.c +++ b/ksrc/skins/posix/syscall.c @@ -422,6 +422,7 @@ static int __pthread_set_name_np(struct pt_regs *regs) { char name[XNOBJECT_NAME_LEN]; struct pse51_hkey hkey; + struct task_struct *p; pthread_t k_tid; if (__xn_safe_strncpy_from_user(name, @@ -434,6 +435,9 @@ static int __pthread_set_name_np(struct pt_regs *regs) hkey.u_tid = __xn_reg_arg1(regs); hkey.mm = current->mm; k_tid = __pthread_find(&hkey); + p = xnthread_user_task(&k_tid->threadbase); + strncpy(p->comm, name, sizeof(p->comm)); + p->comm[sizeof(p->comm) - 1] = '\0'; return -pthread_set_name_np(k_tid, name); } _______________________________________________ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git