<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 19, 2017 at 2:02 PM, Gedare Bloom <span dir="ltr"><<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Tanu,<br>
<br>
This comes into RTEMS through newlib. You have to clone newlib and<br>
search in newlib.git/newlib.<br></blockquote><div><br></div><div><br></div><div>It is installed as part of your tools by the RSB.</div><div><br></div><div>You can #define _GNU_SOURCE before you include any .h files</div><div>or add it to the Makefile or whatever you use. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Side-note: Please ensure to use a properly configured git <a href="http://user.name" rel="noreferrer" target="_blank">user.name</a><br>
and user.email so that git-send-email and git-format-patch will<br>
preserve the correct authorship information.<br>
<span class="HOEnZb"><font color="#888888"><br>
Gedare<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Wed, Apr 19, 2017 at 2:59 PM, Tanu Hari Dixit <<a href="mailto:tokencolour@gmail.com">tokencolour@gmail.com</a>> wrote:<br>
> Hello Joel,<br>
><br>
> I git grepped for the above lines in src/rtems but couldn't find it. I<br>
> couldn't find it in<br>
> /src/rtems/cpukit/posix/<wbr>include/rtems/posix/pthread.h. I don't know<br>
> how to define _GNU_SOURCE. Can you please help me with this?<br>
><br>
> Thank you,<br>
> Tanu Hari Dixit.<br>
><br>
> On Wed, Apr 19, 2017 at 9:38 PM, Joel Sherrill <<a href="mailto:joel@rtems.org">joel@rtems.org</a>> wrote:<br>
>> Hi,<br>
>><br>
>> This is prototyped in pthread.h in the current tools:<br>
>><br>
>>  #if __GNU_VISIBLE<br>
>> int     pthread_getname_np(pthread_t, char *, size_t) __nonnull(2);<br>
>><br>
>> int     pthread_setname_np(pthread_t, const char *) __nonnull(2);<br>
>> #endif<br>
>><br>
>> Do you have current tools? Did you define _GNU_SOURCE so this<br>
>> prototype is visible?<br>
>><br>
>> --joel<br>
>><br>
>><br>
>> Are you sure your to<br>
>><br>
>> On Wed, Apr 19, 2017 at 10:00 AM, tokencolour <<a href="mailto:tokencolour@gmail.com">tokencolour@gmail.com</a>> wrote:<br>
>>><br>
>>> Gets rid of 1 warning --><br>
>>> warning: no previous prototype for 'pthread_getname_np'<br>
>>> [-Wmissing-prototypes]<br>
>>> ---<br>
>>>  cpukit/posix/include/rtems/<wbr>posix/pthreadimpl.h | 5 +++++<br>
>>>  cpukit/posix/src/<wbr>pthreadgetnamenp.c            | 1 +<br>
>>>  2 files changed, 6 insertions(+)<br>
>>><br>
>>> diff --git a/cpukit/posix/include/rtems/<wbr>posix/pthreadimpl.h<br>
>>> b/cpukit/posix/include/rtems/<wbr>posix/pthreadimpl.h<br>
>>> index 90a60b6..51a1a2a 100644<br>
>>> --- a/cpukit/posix/include/rtems/<wbr>posix/pthreadimpl.h<br>
>>> +++ b/cpukit/posix/include/rtems/<wbr>posix/pthreadimpl.h<br>
>>> @@ -111,6 +111,11 @@ int rtems_pthread_attribute_<wbr>compare(<br>
>>>    const pthread_attr_t *attr2<br>
>>>  );<br>
>>><br>
>>> +/*<br>
>>> + * pthread_getname_np<br>
>>> + */<br>
>>> +int pthread_getname_np( pthread_t thread, char *name, size_t len );<br>
>>> +<br>
>>>  RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate(void)<br>
>>>  {<br>
>>>    _Objects_Allocator_lock();<br>
>>> diff --git a/cpukit/posix/src/<wbr>pthreadgetnamenp.c<br>
>>> b/cpukit/posix/src/<wbr>pthreadgetnamenp.c<br>
>>> index e753823..b1a99f0 100644<br>
>>> --- a/cpukit/posix/src/<wbr>pthreadgetnamenp.c<br>
>>> +++ b/cpukit/posix/src/<wbr>pthreadgetnamenp.c<br>
>>> @@ -16,6 +16,7 @@<br>
>>>  #include <string.h><br>
>>><br>
>>>  #include <rtems/score/threadimpl.h><br>
>>> +#include <rtems/posix/pthreadimpl.h><br>
>>><br>
>>>  int pthread_getname_np( pthread_t thread, char *name, size_t len )<br>
>>>  {<br>
>>> --<br>
>>> 2.1.4<br>
>>><br>
>>> ______________________________<wbr>_________________<br>
>>> devel mailing list<br>
>>> <a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
>>> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a><br>
>><br>
>><br>
> ______________________________<wbr>_________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a><br>
</div></div></blockquote></div><br></div></div>