[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <83339ea6-6653-41fe-af75-e0d51a4fa920@t-8ch.de>
Date: Wed, 24 May 2023 22:22:23 +0200
From: Thomas Weißschuh <thomas@...ch.de>
To: Zhangjin Wu <falcon@...ylab.org>
Cc: w@....eu, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-riscv@...ts.infradead.org,
palmer@...belt.com, paul.walmsley@...ive.com
Subject: Re: [PATCH 11/13] tools/nolibc: sys_select: riscv: use
__NR_pselect6_time64 for rv32
On 2023-05-25 01:59:55+0800, Zhangjin Wu wrote:
> rv32 uses the generic include/uapi/asm-generic/unistd.h and it has no
> __NR_pselect6 after kernel commit d4c08b9776b3 ("riscv: Use latest
> system call ABI"), use __NR_pselect6_time64 instead.
>
> Signed-off-by: Zhangjin Wu <falcon@...ylab.org>
> ---
> tools/include/nolibc/sys.h | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h
> index c0335a84f880..00c7197dcd50 100644
> --- a/tools/include/nolibc/sys.h
> +++ b/tools/include/nolibc/sys.h
> @@ -1041,8 +1041,13 @@ int sys_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeva
> struct timeval *t;
> } arg = { .n = nfds, .r = rfds, .w = wfds, .e = efds, .t = timeout };
> return my_syscall1(__NR_select, &arg);
> -#elif defined(__ARCH_WANT_SYS_PSELECT6) && defined(__NR_pselect6)
> +#elif defined(__ARCH_WANT_SYS_PSELECT6) && (defined(__NR_pselect6) || defined(__NR_pselect6_time64))
> +#ifdef __NR_pselect6
> struct timespec t;
> +#else
> + struct timespec64 t;
> +#define __NR_pselect6 __NR_pselect6_time64
Wouldn't this #define leak to the users of nolibc and lead to calls to
pselect6_time64 with the ABI of the __NR_pselect6 if userspace is doing
its own raw syscalls?
> +#endif
>
> if (timeout) {
> t.tv_sec = timeout->tv_sec;
> --
> 2.25.1
>
Powered by blists - more mailing lists