io_uring_register_files(3)

NAME
io_uring_register_files - register file descriptors

SYNOPSIS
#include <liburing.h>

int io_uring_register_files(struct io_uring *ring,
                            const int *files,
                            unsigned nr_files);

int io_uring_register_files_sparse(struct io_uring *ring,
                            unsigned nr_files);

DESCRIPTION

The io_uring_register_files(3) function registers nr_files number of file descriptors defined by the array files belonging to the ring for subsequent operations. The io_uring_register_files_sparse(3) function registers an empty file table of nr_files number of file descriptors. The sparse variant is available in kernels 5.19 and later. Registering a file table is a prerequisite for using any request that uses direct descriptors.

RETURN VALUE
On success io_uring_register_files(3) and io_uring_register_files_sparse(3) return 0. On failure they return -errno.

SEE ALSO
io_uring_get_sqe(3), io_uring_unregister_files(3)