io_uring_register_files - Man Page

register file descriptors


#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);


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)

Referenced By

io_uring_prep_accept(3), io_uring_prep_accept_direct(3), io_uring_prep_multishot_accept(3), io_uring_prep_multishot_accept_direct(3), io_uring_prep_openat(3), io_uring_prep_openat2(3), io_uring_prep_openat2_direct(3), io_uring_prep_openat_direct(3), io_uring_prep_socket(3), io_uring_prep_socket_direct(3), io_uring_register_files(3), io_uring_register_ring_fd(3), io_uring_unregister_files(3), io_uring_unregister_ring_fd(3).

November 15, 2021 liburing-2.1 liburing Manual