[PATCH v3] sys/lock.h: Add clock selection APIs for the
Sebastian Huber
sebastian.huber@embedded-brains.de
Thu Mar 5 13:01:36 GMT 2026
----- Am 3. Mrz 2026 um 22:58 schrieb Mazen Adel Elmessady mez3n1151@gmail.com:
> Updated _Semaphore_Wait_timed (which is currently unused in RTEMS)
> to _Semaphore_Wait_timed_clock which
> to be used in RTEMS sempahore API.
> This will ease the support of the new clock
> functions added in Posix Issue 8.
>
> V2: Kept _Semaphore_Wait_timed while adding
> _Semaphore_Wait_timed_clock
>
> V3: Added _Mutex_Acquire_timed_clock()
> _Mutex_recursive_Acquire_timed_clock()
> _Condition_Wait_timed_clock()
> _Condition_Wait_recursive_timed_clock()
> To include all the clock selection APIs for
> all of the synchronization object class
> ---
> newlib/libc/sys/rtems/include/sys/lock.h | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/newlib/libc/sys/rtems/include/sys/lock.h
> b/newlib/libc/sys/rtems/include/sys/lock.h
> index d6169025b..79fb6b2de 100644
> --- a/newlib/libc/sys/rtems/include/sys/lock.h
> +++ b/newlib/libc/sys/rtems/include/sys/lock.h
> @@ -27,6 +27,7 @@
> #define _SYS_LOCK_H_
>
> #include <sys/cdefs.h>
> +#include <sys/_timespec.h>
In this case, you can drop the struct timespec forward declaration below.
> #include <stddef.h>
>
> __BEGIN_DECLS
> @@ -137,6 +138,9 @@ void _Mutex_Acquire(struct _Mutex_Control *);
>
> int _Mutex_Acquire_timed(struct _Mutex_Control *, const struct timespec *);
>
> +int _Mutex_Acquire_timed_clock(struct _Mutex_Control *,
> + const struct timespec *, __clockid_t)
Missing ';'?
Did you test building GCC with this patch?
Please keep the four spaces line continuation format of the FreeBSD style in this file.
The rest looks good.
[...]
--
Visit us at EMBEDDED WORLD 2026 in Nuremberg 10 to 12 March, Hall 4 Booth 622!
--
embedded brains GmbH & Co. KG
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax: +49-89-18 94 741 - 08
Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
More information about the Newlib
mailing list