[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <d0c6b2fd-1bba-4a9a-add1-b7c29ada7dd2@app.fastmail.com>
Date: Thu, 30 Oct 2025 15:56:19 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: Thomas Weißschuh <linux@...ssschuh.net>,
 "Willy Tarreau" <w@....eu>, shuah <shuah@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH 02/12] tools/nolibc: handle 64-bit off_t for llseek
On Wed, Oct 29, 2025, at 17:02, Thomas Weißschuh wrote:
> Correctly handle 64-bit off_t values in preparation for 64-bit off_t on
> 32-bit architectures.
>
> Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
> ---
>  tools/include/nolibc/sys.h | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h
> index 386ed80aead0..321a3bd16ff4 100644
> --- a/tools/include/nolibc/sys.h
> +++ b/tools/include/nolibc/sys.h
> @@ -599,8 +599,7 @@ off_t sys_lseek(int fd, off_t offset, int whence)
>  	off_t result;
>  	int ret;
> 
> -	/* Only exists on 32bit where nolibc off_t is also 32bit */
> -	ret = my_syscall5(__NR_llseek, fd, 0, offset, &loff, whence);
> +	ret = my_syscall5(__NR_llseek, fd, offset >> 32, (uint32_t)offset, 
> &loff, whence);
Acked-by: Arnd Bergmann <arnd@...db.de>
This one is easier than some of the others because it passes
the two halves explictly. It's a bit trickier for preadv/pwritev,
preadv2/pwritev2, fallocate, truncate64/ftruncate64, sync_file_range,
and fadvise64/fadvise64_64, all of which have slightly tricky
calling conventions. Not sure if any of these are currently
supported in nolibc.
    Arnd
Powered by blists - more mailing lists
 
