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:
> <http://www.xenomai.org/pipermail/xenomai/attachments/20130509/0255686a/attachment.obj>
> _______________________________________________
> Xenomai mailing list
> [email protected]
> 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.
_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai