Man page - io_uring_register_files(3)
Packages contains this manual
- io_uring_register_buffers_sparse(3)
- io_uring_register_napi(3)
- io_uring_prep_poll_multishot(3)
- io_uring_prep_multishot_accept_direct(3)
- io_uring_prep_multishot_accept(3)
- io_uring_clone_buffers(3)
- io_uring_buf_ring_available(3)
- io_uring_submit_and_wait_reg(3)
- io_uring_prep_futex_waitv(3)
- io_uring_prep_rename(3)
- io_uring_major_version(3)
- io_uring_prep_mkdir(3)
- io_uring_register_files_update(3)
- io_uring_sq_ready(3)
- io_uring_register_reg_wait(3)
- io_uring_prep_timeout(3)
- io_uring_register_iowq_aff(3)
- io_uring_submit(3)
- io_uring_unregister_napi(3)
- io_uring_prep_open_direct(3)
- io_uring_queue_init_params(3)
- io_uring_prep_openat2_direct(3)
- io_uring_buf_ring_advance(3)
- io_uring_unregister_eventfd(3)
- io_uring_submit_and_wait_min_timeout(3)
- io_uring_recvmsg_cmsg_nexthdr(3)
- io_uring_prep_renameat(3)
- io_uring_prep_recv(3)
- io_uring_prep_unlink(3)
- io_uring_prep_cancel(3)
- io_uring_prep_mkdirat(3)
- io_uring_prep_getxattr(3)
- io_uring_prep_close(3)
- io_uring_prep_send(3)
- io_uring_enable_rings(3)
- io_uring_register_clock(3)
- io_uring_minor_version(3)
- io_uring_prep_send_set_addr(3)
- io_uring_prep_sendmsg(3)
- io_uring_prep_fixed_fd_install(3)
- io_uring_queue_exit(3)
- io_uring_submit_and_wait_timeout(3)
- io_uring_for_each_cqe(3)
- io_uring_setup_reg_wait(3)
- io_uring_sqe_set_buf_group(3)
- io_uring_prep_sendmsg_zc(3)
- io_uring_prep_read_fixed(3)
- io_uring_submit_and_get_events(3)
- io_uring_unregister_buffers(3)
- io_uring_prep_symlink(3)
- io_uring_prep_send_zc_fixed(3)
- io_uring_prep_connect(3)
- io_uring_buf_ring_mask(3)
- io_uring_prep_cmd(3)
- io_uring_prep_sendto(3)
- io_uring_prep_write(3)
- io_uring_prep_files_update(3)
- io_uring_prep_setxattr(3)
- io_uring_peek_batch_cqe(3)
- io_uring_prep_msg_ring(3)
- io_uring_prep_cmd_discard(3)
- io_uring_prep_writev2(3)
- io_uring_register_sync_cancel(3)
- io_uring_prep_poll_add(3)
- io_uring_prep_close_direct(3)
- io_uring_prep_unlinkat(3)
- io_uring_recvmsg_validate(3)
- io_uring_prep_fgetxattr(3)
- io_uring_register_buf_ring(3)
- io_uring_unregister_files(3)
- io_uring_prep_splice(3)
- io_uring_register_buffers(3)
- io_uring_prep_ftruncate(3)
- io_uring_prep_recvmsg(3)
- io_uring_prep_poll_remove(3)
- io_uring_prep_link_timeout(3)
- io_uring_peek_cqe(3)
- io_uring_resize_rings(3)
- io_uring_prep_msg_ring_cqe_flags(3)
- io_uring_prep_statx(3)
- io_uring_free_reg_wait(3)
- io_uring_register(2)
- io_uring_cqe_seen(3)
- io_uring_prep_recv_multishot(3)
- io_uring_enter2(2)
- io_uring_prep_poll_update(3)
- io_uring_prep_readv2(3)
- io_uring_prep_writev(3)
- io_uring_unregister_iowq_aff(3)
- io_uring_get_sqe(3)
- io_uring_clone_buffers_offset(3)
- io_uring_prep_tee(3)
- io_uring_prep_bind(3)
- io_uring_prep_msg_ring_fd(3)
- io_uring_prep_openat_direct(3)
- io_uring(7)
- io_uring_wait_cqe_timeout(3)
- io_uring_prep_provide_buffers(3)
- io_uring_setup_buf_ring(3)
- io_uring_sqe_set_flags(3)
- io_uring_prep_futex_wake(3)
- io_uring_register_ring_fd(3)
- io_uring_submit_and_wait(3)
- io_uring_wait_cqes_min_timeout(3)
- io_uring_prep_sync_file_range(3)
- io_uring_wait_cqe_nr(3)
- io_uring_prep_send_zc(3)
- io_uring_cqe_get_data64(3)
- io_uring_cq_ready(3)
- io_uring_free_probe(3)
- io_uring_prep_accept_direct(3)
- io_uring_prep_fsetxattr(3)
- io_uring_enter(2)
- io_uring_queue_init(3)
- io_uring_register_files_tags(3)
- io_uring_prep_openat2(3)
- io_uring_get_events(3)
- io_uring_close_ring_fd(3)
- io_uring_register_file_alloc_range(3)
- io_uring_cq_has_overflow(3)
- io_uring_prep_symlinkat(3)
- io_uring_wait_cqes(3)
- io_uring_prep_fsync(3)
- io_uring_sqe_set_data(3)
- io_uring_wait_cqe(3)
- io_uring_opcode_supported(3)
- io_uring_prep_cancel_fd(3)
- io_uring_register_buffers_update_tag(3)
- io_uring_sq_space_left(3)
- io_uring_prep_read_multishot(3)
- io_uring_buf_ring_cq_advance(3)
- io_uring_prep_write_fixed(3)
- io_uring_prep_msg_ring_fd_alloc(3)
- io_uring_recvmsg_payload(3)
- io_uring_prep_remove_buffers(3)
- io_uring_prep_readv(3)
- io_uring_prep_nop(3)
- io_uring_prep_fallocate(3)
- io_uring_buf_ring_add(3)
- io_uring_prep_send_bundle(3)
- io_uring_sqe_set_data64(3)
- io_uring_unregister_buf_ring(3)
- io_uring_prep_linkat(3)
- io_uring_prep_fadvise64(3)
- io_uring_prep_fadvise(3)
- io_uring_prep_open(3)
- io_uring_cqe_get_data(3)
- io_uring_register_eventfd_async(3)
- io_uring_prep_read(3)
- io_uring_sqring_wait(3)
- __io_uring_buf_ring_cq_advance(3)
- io_uring_recvmsg_name(3)
- io_uring_prep_listen(3)
- io_uring_queue_init_mem(3)
- io_uring_register_eventfd(3)
- io_uring_recvmsg_payload_length(3)
- io_uring_prep_socket_direct_alloc(3)
- io_uring_get_probe(3)
- io_uring_register_files(3)
- io_uring_prep_link(3)
- io_uring_prep_waitid(3)
- io_uring_check_version(3)
- io_uring_cq_advance(3)
- io_uring_prep_madvise(3)
- io_uring_prep_accept(3)
- io_uring_register_files_sparse(3)
- io_uring_buf_ring_init(3)
- io_uring_prep_socket(3)
- io_uring_prep_shutdown(3)
- io_uring_recvmsg_out(3)
- io_uring_prep_timeout_remove(3)
- io_uring_prep_recvmsg_multishot(3)
- io_uring_unregister_ring_fd(3)
- io_uring_prep_openat(3)
- io_uring_free_buf_ring(3)
- io_uring_prep_timeout_update(3)
- io_uring_register_buffers_tags(3)
- io_uring_register_iowq_max_workers(3)
- io_uring_register_files_update_tag(3)
- io_uring_prep_futex_wait(3)
- io_uring_recvmsg_cmsg_firsthdr(3)
- io_uring_prep_madvise64(3)
- io_uring_prep_cancel64(3)
- io_uring_setup(2)
- io_uring_prep_socket_direct(3)
apt-get install liburing-dev
Manual
io_uring_register_files
NAMESYNOPSIS
DESCRIPTION
RETURN VALUE
SEE ALSO
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_tags(struct io_uring
*
ring
,
const int *
files
,
const __u64 *
tags
,
unsigned
nr
);
int
io_uring_register_files_sparse(struct io_uring
*
ring
,
unsigned
nr_files
);
int
io_uring_register_files_update(struct io_uring
*
ring
,
unsigned
off
,
const int *
files
,
unsigned
nr_files
);
int
io_uring_register_files_update_tag(struct io_uring
*
ring
,
unsigned
off
,
const int *
files
,
const __u64 *
tags
,
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_tags (3) function behaves the same as io_uring_register_files (3) function but additionally takes tags parameter. See IORING_REGISTER_BUFFERS2 for the resource tagging description.
The io_uring_register_files_sparse (3) function registers an empty file table of nr_files number of file descriptors. These files must be updated before use, using eg io_uring_register_files_update_tag (3). Note that if the size of the sparse table exceeds what RLIMIT_NOFILE allows, then io_uring_register_files_sparse (3) will attempt to raise the limit using setrlimit (2) and retry the operation. If the registration fails after doing that, then an error will be returned. 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.
Registered files have less overhead per operation than normal files. This is due to the kernel grabbing a reference count on a file when an operation begins, and dropping it when itβs done. When the process file table is shared, for example if the process has ever created any threads, then this cost goes up even more. Using registered files reduces the overhead of file reference management across requests that operate on a file.
The io_uring_register_files_update (3) function updates existing registered files. The off is offset on which to start the update nr_files number of files defined by the array files belonging to the ring .
The io_uring_register_files_update_tag (3) function behaves the same as io_uring_register_files_update (3) function but additionally takes tags parameter. See IORING_REGISTER_BUFFERS2 for the resource tagging description.
RETURN VALUE
On success io_uring_register_files (3), io_uring_register_files_tags (3) and io_uring_register_files_sparse (3) return 0. io_uring_register_files_update (3) and io_uring_register_files_update_tag (3) return number of files updated. On failure they return -errno .
SEE ALSO
io_uring_register (2), io_uring_get_sqe (3), io_uring_unregister_files (3)