Re: [PATCH v2] tools/nolibc: make signature of ioctl() more flexible

From: Willy Tarreau
Date: Thu Jan 30 2025 - 03:24:53 EST


On Tue, Jan 28, 2025 at 10:22:46PM +0100, Thomas Weißschuh wrote:
> POSIX defines the signature of ioctl() as follows,
> to allow passing a pointer or integer without casting:
> int ioctl(int fildes, int request, ... /* arg */);
>
> Nolibc ioctl() expects a pointer, forcing the user to manually cast.
> Using va_arg to make the signature more flexible would work but seems to
> prevent inlining of the function. Instead use a macro. "fd" and "req"
> will still be typechecked through sys_ioctl().
>
> Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>

Nice and clean approach indeed!

Acked-by: Willy Tarreau <w@xxxxxx>

Willy