From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <518BE26B.4080408@xenomai.org> Date: Thu, 09 May 2013 19:52:43 +0200 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <518BB895.3050208@xenomai.org> <518BBFDC.7060102@xenomai.org> <518BC2C3.3080004@xenomai.org> <518BC59F.60208@xenomai.org> <518BCB6B.5070908@xenomai.org> <518BCD6C.8060501@xenomai.org> <518BD2BF.3040801@xenomai.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai] [Posix] I/O multiplexing with select List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: alex alex Cc: Xenomai On 05/09/2013 06:56 PM, alex alex wrote: > vmlinux file > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: vmlinux > Type: application/octet-stream > Size: 11189780 bytes > Desc: not available > URL: > _______________________________________________ > Xenomai mailing list > Xenomai@xenomai.org > http://www.xenomai.org/mailman/listinfo/xenomai > Please try that one instead: diff --git a/ksrc/skins/posix/syscall.c b/ksrc/skins/posix/syscall.c index 49ed764..6fbe4c4 100644 --- a/ksrc/skins/posix/syscall.c +++ b/ksrc/skins/posix/syscall.c @@ -435,11 +435,6 @@ 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); - if (k_tid) { - 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); } diff --git a/ksrc/skins/posix/thread.c b/ksrc/skins/posix/thread.c index 01fc699..78f5634 100644 --- a/ksrc/skins/posix/thread.c +++ b/ksrc/skins/posix/thread.c @@ -715,6 +715,9 @@ int pthread_set_mode_np(int clrmask, int setmask) */ int pthread_set_name_np(pthread_t thread, const char *name) { +#ifdef CONFIG_XENO_OPT_PERVASIVE + struct task_struct *p; +#endif /* CONFIG_XENO_OPT_PERVASIVE */ spl_t s; xnlock_get_irqsave(&nklock, s); @@ -727,6 +730,14 @@ int pthread_set_name_np(pthread_t thread, const char *name) snprintf(xnthread_name(&thread->threadbase), XNOBJECT_NAME_LEN, "%s", name); +#ifdef CONFIG_XENO_OPT_PERVASIVE + p = xnthread_user_task(&thread->threadbase); + if (p) { + strncpy(p->comm, name, sizeof(p->comm)); + p->comm[sizeof(p->comm) - 1] = '\0'; + } +#endif /* CONFIG_XENO_OPT_PERVASIVE */ + xnlock_put_irqrestore(&nklock, s); return 0; -- Gilles.