[PATCH] Added declaration of method pthread_getname_np

Tanu Hari Dixit tokencolour at gmail.com
Wed Apr 19 18:59:31 UTC 2017


Hello Joel,

I git grepped for the above lines in src/rtems but couldn't find it. I
couldn't find it in
/src/rtems/cpukit/posix/include/rtems/posix/pthread.h. I don't know
how to define _GNU_SOURCE. Can you please help me with this?

Thank you,
Tanu Hari Dixit.

On Wed, Apr 19, 2017 at 9:38 PM, Joel Sherrill <joel at rtems.org> wrote:
> Hi,
>
> This is prototyped in pthread.h in the current tools:
>
>  #if __GNU_VISIBLE
> int     pthread_getname_np(pthread_t, char *, size_t) __nonnull(2);
>
> int     pthread_setname_np(pthread_t, const char *) __nonnull(2);
> #endif
>
> Do you have current tools? Did you define _GNU_SOURCE so this
> prototype is visible?
>
> --joel
>
>
> Are you sure your to
>
> On Wed, Apr 19, 2017 at 10:00 AM, tokencolour <tokencolour at gmail.com> wrote:
>>
>> Gets rid of 1 warning -->
>> warning: no previous prototype for 'pthread_getname_np'
>> [-Wmissing-prototypes]
>> ---
>>  cpukit/posix/include/rtems/posix/pthreadimpl.h | 5 +++++
>>  cpukit/posix/src/pthreadgetnamenp.c            | 1 +
>>  2 files changed, 6 insertions(+)
>>
>> diff --git a/cpukit/posix/include/rtems/posix/pthreadimpl.h
>> b/cpukit/posix/include/rtems/posix/pthreadimpl.h
>> index 90a60b6..51a1a2a 100644
>> --- a/cpukit/posix/include/rtems/posix/pthreadimpl.h
>> +++ b/cpukit/posix/include/rtems/posix/pthreadimpl.h
>> @@ -111,6 +111,11 @@ int rtems_pthread_attribute_compare(
>>    const pthread_attr_t *attr2
>>  );
>>
>> +/*
>> + * pthread_getname_np
>> + */
>> +int pthread_getname_np( pthread_t thread, char *name, size_t len );
>> +
>>  RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate(void)
>>  {
>>    _Objects_Allocator_lock();
>> diff --git a/cpukit/posix/src/pthreadgetnamenp.c
>> b/cpukit/posix/src/pthreadgetnamenp.c
>> index e753823..b1a99f0 100644
>> --- a/cpukit/posix/src/pthreadgetnamenp.c
>> +++ b/cpukit/posix/src/pthreadgetnamenp.c
>> @@ -16,6 +16,7 @@
>>  #include <string.h>
>>
>>  #include <rtems/score/threadimpl.h>
>> +#include <rtems/posix/pthreadimpl.h>
>>
>>  int pthread_getname_np( pthread_t thread, char *name, size_t len )
>>  {
>> --
>> 2.1.4
>>
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>
>



More information about the devel mailing list