Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260713134152.GW27423@brightrain.aerifal.cx>
Date: Mon, 13 Jul 2026 09:41:52 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] clock_nanosleep: define SYS_nanosleep to fix
 riscv32

On Mon, Jul 13, 2026 at 12:11:36PM +0200, Szabolcs Nagy wrote:
> riscv32 does not have SYS_nanosleep, but it is used in unreachable
> fallback code.
> ---
> low effort fix for
> 
> build.log:src/time/clock_nanosleep.c: In function '__clock_nanosleep':
> build.log:src/time/clock_nanosleep.c:23:34: error: 'SYS_nanosleep' undeclared (first use in this function); did you mean 'nanosleep'?
> build.log:   23 |                 r = __syscall_cp(SYS_nanosleep, &ts32, &ts32);
> build.log-      |                                  ^~~~~~~~~~~~~
> 
>  src/internal/syscall.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/internal/syscall.h b/src/internal/syscall.h
> index 2d8a5c13..706dd41e 100644
> --- a/src/internal/syscall.h
> +++ b/src/internal/syscall.h
> @@ -264,6 +264,9 @@ static inline long __alt_socketcall(int sys, int sock, int cp, syscall_arg_t a,
>  
>  #ifndef SYS_clock_nanosleep
>  #define SYS_clock_nanosleep SYS_clock_nanosleep_time64
> +#ifndef SYS_nanosleep
> +#define SYS_nanosleep -1
> +#endif
>  #endif
>  
>  #ifndef SYS_timer_gettime
> -- 
> 2.52.0

Being that there's only one file using the syscall, I think maybe I'd
rather put the conditional there.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.