Re: [PATCH 1/1] libc: Added prototypes for new POSIX APIs
On Fri, Aug 6, 2021 at 8:37 AM Matt Joyce wrote: > > Added function prototypes to newlib/libc/include/pthread.h > for the following Issue 8 Standard APIs: > pthread_cond_clockwait() > pthread_mutex_clocklock() > pthread_rwlock_clockrdlock() > pthread_rwlock_clockwrlock() > --- > newlib/libc/include/pthread.h | 31 +++ > 1 file changed, 31 insertions(+) > > diff --git a/newlib/libc/include/pthread.h b/newlib/libc/include/pthread.h > index c9d24d6e0..77cb0ed74 100644 > --- a/newlib/libc/include/pthread.h > +++ b/newlib/libc/include/pthread.h > @@ -87,6 +87,15 @@ int pthread_mutex_timedlock (pthread_mutex_t *__mutex, > > #endif /* _POSIX_TIMEOUTS */ > > +/* Using __MISC_VISIBLE until POSIX Issue 8 is officially released */ > +#if __MISC_VISIBLE > + > +/* The Issue 8 standard adds pthread_mutex_clocklock() */ > +int pthread_mutex_clocklock(pthread_mutex_t *__restrict, clockid_t, > + const struct timespec *__restrict); > + > +#endif /* __MISC_VISIBLE */ > + I don't know that you need white space after the #if and before the #endif in newlib headers. With that change, I'd say it is ready to submit. > /* Condition Variable Initialization Attributes, P1003.1c/Draft 10, p. 96 */ > > intpthread_condattr_init (pthread_condattr_t *__attr); > @@ -126,6 +135,16 @@ intpthread_cond_wait (pthread_cond_t *__cond, > pthread_mutex_t *__mutex); > intpthread_cond_timedwait (pthread_cond_t *__cond, > pthread_mutex_t *__mutex, > const struct timespec *__abstime); > + > +/* Using __MISC_VISIBLE until POSIX Issue 8 is officially released */ > +#if __MISC_VISIBLE > + > +/* The Issue 8 standard adds pthread_cond_clockwait() */ > +int pthread_cond_clockwait(pthread_cond_t *__restrict, > + pthread_mutex_t *__restrict, clockid_t, > + const struct timespec *__restrict); > + > +#endif /* __MISC_VISIBLE */ > > #if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) > > @@ -423,6 +442,18 @@ intpthread_rwlock_trywrlock (pthread_rwlock_t > *__rwlock); > intpthread_rwlock_timedwrlock (pthread_rwlock_t *__rwlock, > const struct timespec *__abstime); > > +/* Using __MISC_VISIBLE until POSIX Issue 8 is officially released */ > +#if __MISC_VISIBLE > + > +/* The Issue 8 standard adds pthread_rwlock_clockrdlock() > +* and pthread_rwlock_clockwrlock()*/ > +int pthread_rwlock_clockrdlock(pthread_rwlock_t *__restrict, clockid_t, > + const struct timespec *__restrict); > +int pthread_rwlock_clockwrlock(pthread_rwlock_t *__restrict, clockid_t, > + const struct timespec *__restrict); > + > +#endif /* __MISC_VISIBLE */ > + > #endif /* defined(_POSIX_READER_WRITER_LOCKS) */ > > > -- > 2.31.1 > > ___ > devel mailing list > devel@rtems.org > http://lists.rtems.org/mailman/listinfo/devel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 1/1] libc: Added prototypes for new POSIX APIs
Thanks very much for the quick reply! Ok, I'll make that change and submit. Sincerely, Matt On Fri, Aug 6, 2021 at 3:52 PM Joel Sherrill wrote: > > On Fri, Aug 6, 2021 at 8:37 AM Matt Joyce wrote: > > > > Added function prototypes to newlib/libc/include/pthread.h > > for the following Issue 8 Standard APIs: > > pthread_cond_clockwait() > > pthread_mutex_clocklock() > > pthread_rwlock_clockrdlock() > > pthread_rwlock_clockwrlock() > > --- > > newlib/libc/include/pthread.h | 31 +++ > > 1 file changed, 31 insertions(+) > > > > diff --git a/newlib/libc/include/pthread.h b/newlib/libc/include/pthread.h > > index c9d24d6e0..77cb0ed74 100644 > > --- a/newlib/libc/include/pthread.h > > +++ b/newlib/libc/include/pthread.h > > @@ -87,6 +87,15 @@ int pthread_mutex_timedlock (pthread_mutex_t *__mutex, > > > > #endif /* _POSIX_TIMEOUTS */ > > > > +/* Using __MISC_VISIBLE until POSIX Issue 8 is officially released */ > > +#if __MISC_VISIBLE > > + > > +/* The Issue 8 standard adds pthread_mutex_clocklock() */ > > +int pthread_mutex_clocklock(pthread_mutex_t *__restrict, clockid_t, > > + const struct timespec *__restrict); > > + > > +#endif /* __MISC_VISIBLE */ > > + > > I don't know that you need white space after the #if and before the #endif > in newlib headers. > > With that change, I'd say it is ready to submit. > > > /* Condition Variable Initialization Attributes, P1003.1c/Draft 10, p. 96 > > */ > > > > intpthread_condattr_init (pthread_condattr_t *__attr); > > @@ -126,6 +135,16 @@ intpthread_cond_wait (pthread_cond_t *__cond, > > pthread_mutex_t *__mutex); > > intpthread_cond_timedwait (pthread_cond_t *__cond, > > pthread_mutex_t *__mutex, > > const struct timespec *__abstime); > > + > > +/* Using __MISC_VISIBLE until POSIX Issue 8 is officially released */ > > +#if __MISC_VISIBLE > > + > > +/* The Issue 8 standard adds pthread_cond_clockwait() */ > > +int pthread_cond_clockwait(pthread_cond_t *__restrict, > > + pthread_mutex_t *__restrict, clockid_t, > > + const struct timespec *__restrict); > > + > > +#endif /* __MISC_VISIBLE */ > > > > #if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) > > > > @@ -423,6 +442,18 @@ intpthread_rwlock_trywrlock (pthread_rwlock_t > > *__rwlock); > > intpthread_rwlock_timedwrlock (pthread_rwlock_t *__rwlock, > > const struct timespec *__abstime); > > > > +/* Using __MISC_VISIBLE until POSIX Issue 8 is officially released */ > > +#if __MISC_VISIBLE > > + > > +/* The Issue 8 standard adds pthread_rwlock_clockrdlock() > > +* and pthread_rwlock_clockwrlock()*/ > > +int pthread_rwlock_clockrdlock(pthread_rwlock_t *__restrict, clockid_t, > > + const struct timespec *__restrict); > > +int pthread_rwlock_clockwrlock(pthread_rwlock_t *__restrict, clockid_t, > > + const struct timespec *__restrict); > > + > > +#endif /* __MISC_VISIBLE */ > > + > > #endif /* defined(_POSIX_READER_WRITER_LOCKS) */ > > > > > > -- > > 2.31.1 > > > > ___ > > devel mailing list > > devel@rtems.org > > http://lists.rtems.org/mailman/listinfo/devel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 1/1] libc: Added prototypes for new POSIX APIs
Added function prototypes to newlib/libc/include/pthread.h for the following Issue 8 Standard APIs: pthread_cond_clockwait() pthread_mutex_clocklock() pthread_rwlock_clockrdlock() pthread_rwlock_clockwrlock() --- newlib/libc/include/pthread.h | 31 +++ 1 file changed, 31 insertions(+) diff --git a/newlib/libc/include/pthread.h b/newlib/libc/include/pthread.h index c9d24d6e0..77cb0ed74 100644 --- a/newlib/libc/include/pthread.h +++ b/newlib/libc/include/pthread.h @@ -87,6 +87,15 @@ int pthread_mutex_timedlock (pthread_mutex_t *__mutex, #endif /* _POSIX_TIMEOUTS */ +/* Using __MISC_VISIBLE until POSIX Issue 8 is officially released */ +#if __MISC_VISIBLE + +/* The Issue 8 standard adds pthread_mutex_clocklock() */ +int pthread_mutex_clocklock(pthread_mutex_t *__restrict, clockid_t, + const struct timespec *__restrict); + +#endif /* __MISC_VISIBLE */ + /* Condition Variable Initialization Attributes, P1003.1c/Draft 10, p. 96 */ intpthread_condattr_init (pthread_condattr_t *__attr); @@ -126,6 +135,16 @@ intpthread_cond_wait (pthread_cond_t *__cond, pthread_mutex_t *__mutex); intpthread_cond_timedwait (pthread_cond_t *__cond, pthread_mutex_t *__mutex, const struct timespec *__abstime); + +/* Using __MISC_VISIBLE until POSIX Issue 8 is officially released */ +#if __MISC_VISIBLE + +/* The Issue 8 standard adds pthread_cond_clockwait() */ +int pthread_cond_clockwait(pthread_cond_t *__restrict, + pthread_mutex_t *__restrict, clockid_t, + const struct timespec *__restrict); + +#endif /* __MISC_VISIBLE */ #if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) @@ -423,6 +442,18 @@ intpthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock); intpthread_rwlock_timedwrlock (pthread_rwlock_t *__rwlock, const struct timespec *__abstime); +/* Using __MISC_VISIBLE until POSIX Issue 8 is officially released */ +#if __MISC_VISIBLE + +/* The Issue 8 standard adds pthread_rwlock_clockrdlock() +* and pthread_rwlock_clockwrlock()*/ +int pthread_rwlock_clockrdlock(pthread_rwlock_t *__restrict, clockid_t, + const struct timespec *__restrict); +int pthread_rwlock_clockwrlock(pthread_rwlock_t *__restrict, clockid_t, + const struct timespec *__restrict); + +#endif /* __MISC_VISIBLE */ + #endif /* defined(_POSIX_READER_WRITER_LOCKS) */ -- 2.31.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel