Re: [PATCH v3] sys/lock.h: Add clock selection APIs for the

Sebastian Huber <[email protected]> Thu, 5 Mar 2026 14:01:36 +0100 (CET)
Newsgroups gmane.comp.lib.newlib
Message-ID <1463755244.34910.1772715696565.JavaMail.zimbra@embedded-brains.de>
----- Am 3. Mrz 2026 um 22:58 schrieb Mazen Adel Elmessady [email protected]:

> 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: [email protected]
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/