[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+N76C7hfcu5Ze/J@1wt.eu>
Date: Wed, 8 Feb 2023 11:39:36 +0100
From: Willy Tarreau <w@....eu>
To: chris.chenfeiyang@...il.com
Cc: paulmck@...nel.org, Feiyang Chen <chenfeiyang@...ngson.cn>,
arnd@...db.de, chenhuacai@...nel.org, jiaxun.yang@...goat.com,
loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/5] tools/nolibc: Add statx() and make stat() rely on
statx() when available
Hi Feiyang,
On Wed, Feb 08, 2023 at 06:17:51PM +0800, chris.chenfeiyang@...il.com wrote:
> From: Feiyang Chen <chenfeiyang@...ngson.cn>
>
> loongarch and riscv32 only have statx(). arc, hexagon, nios2 and
> openrisc have statx() and stat64() but not stat() or newstat().
> Add statx() and make stat() rely on statx() to make them happy.
Thanks for this, that's way better. I'm just having one small request
below:
> +/*
> + * int statx(int fd, const char *path, int flags, unsigned int mask, struct statx *buf);
> + */
> +
> +static __attribute__((unused))
> +int sys_statx(int fd, const char *path, int flags, unsigned int mask, struct statx *buf)
> +{
> + return my_syscall5(__NR_statx, fd, path, flags, mask, buf);
> +}
> +
> +static __attribute__((unused))
> +int statx(int fd, const char *path, int flags, unsigned int mask, struct statx *buf)
> +{
> + int ret = sys_statx(fd, path, flags, mask, buf);
> +
> + if (ret < 0) {
> + SET_ERRNO(-ret);
> + ret = -1;
> + }
> + return ret;
> +}
Please guard these inside #if defined(__NR_statx) so that this can still
be used as-is from slightly older toolchains that provide their own kernel
includes.
The rest of the series looks pretty good to me.
Thank you!
Willy
Powered by blists - more mailing lists