This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Support for pthread_setname_np / pthread_getname_np


On Fri, 2010-03-19 at 08:14 +0100, Bert Wesarg wrote:
> On Fri, Mar 19, 2010 at 01:49, John Stultz <johnstul@us.ibm.com> wrote:
> > I've recently committed support to the Linux kernel for accessing and
> > setting a threads comm value via the proc interface. This should allow
> > for pthread_setname_np() / pthread_getname_np() functionality to be
> > implemented in glibc.
> >
> > See the kernel git commit here:
> > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=4614a696bd1c3a9af3a08f0e5874830a85b889d4
> >
> > I'm very unfamiliar with glibc and its coding conventions wanted to send
> > out a very raw first pass of how such functionality could be (poorly)
> > implemented.
> >
> > Any feedback, suggestions or total rewrites by more skilled coders would
> > be welcome!
> >
> > thanks
> > -john
> 
> > diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h
> > index b84fd5c..b82057c 100644
> > --- a/nptl/sysdeps/pthread/pthread.h
> > +++ b/nptl/sysdeps/pthread/pthread.h
> > @@ -1095,6 +1095,12 @@ extern int pthread_setspecific (pthread_key_t __key,
> >                                __const void *__pointer) __THROW ;
> >
> >
> > +extern int pthread_setname_np (pthread_t __th, char *__name)
> > +     __THROW __nonnull ((2));
> > +
> > +extern int pthread_getname_np (pthread_t __th, char *__name)
> > +     __THROW __nonnull ((2));
> 
> Why does have the get routine not a size parameter for the name buffer?

Ah. Good catch. I missed implementing it.

Thanks for the review!

-john


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]