bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/3] kern: implement task_set_name


From: Samuel Thibault
Subject: Re: [PATCH 1/3] kern: implement task_set_name
Date: Tue, 4 Feb 2014 13:27:04 +0100
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Pino Toscano, le Tue 04 Feb 2014 12:57:15 +0100, a écrit :
> On Tuesday 04 February 2014 11:01:52 Justus Winter wrote:
> >  /*
> > + * task_set_name
> > + *
> > + * Set the name of task TASK to NAME.  This is a debugging aid.
> > + * NAME will be used in error messages printed by the kernel.
> > + */
> > +kern_return_t
> > +task_set_name(
> > +   task_t                  task,
> > +   kernel_debug_name_t     name)
> > +{
> > +   strncpy(task->name, name, sizeof task->name - 1);
> > +   task->name[sizeof task->name - 1] = '\0';
> > +   return KERN_SUCCESS;
> > +}
> 
> Would it be possible to add task_get_name too, so we can implement 
> pthread_{get,set}name_np in libpthread?

That would rather be thread_set/get_name, then.

Now I remember the discussion about this: it was considered to add
the name field to ipc_port, simply. This would allow to have names on
projected files in processes (for a /proc/self/maps file), etc.

That might be quite expensive, however.

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]