On Tue, Jan 15, 2019 at 3:56 AM Jens Axboe <[email protected]> wrote:
> @@ -132,4 +139,12 @@ struct io_uring_register_buffers {
> __u32 nr_iovecs;
> };
>
> +struct io_uring_register_files {
> + union {
> + __s32 *fds;
> + __u64 pad;
> + };
> + __u32 nr_fds;
> +};
I think you should either remove the pad field here, or pass the pointer
using a __u64 argument itself. With the current definition, the ioctl
command code is the same between 32-bit and 64-bit architectures
(since the length is the same on anything other than x86), but the
structures are incompatible.
I would also suggest adding an explicit 32-bit pad field at the end
of the structure, to avoid the implicit padding on non-i386 machines.
Arnd