[PATCH] Added declaration of method pthread_getname_np
Joel Sherrill
joel at rtems.org
Wed Apr 19 16:08:05 UTC 2017
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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20170419/55eafb48/attachment-0002.html>
More information about the devel
mailing list