Sha256: 3309257b71a73f04f4766c36eaa026b41398d38255abed76dd993c2bc29fccd1

Contents?: true

Size: 1.7 KB

Versions: 4

Compression:

Stored size: 1.7 KB

Contents

.\" Copyright (C) 2021 Stefan Roesch <shr@fb.com>
.\"
.\" SPDX-License-Identifier: LGPL-2.0-or-later
.\"
.TH io_uring_register_files 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
.SH NAME
io_uring_register_files \- register file descriptors
.SH SYNOPSIS
.nf
.B #include <liburing.h>
.PP
.BI "int io_uring_register_files(struct io_uring *" ring ","
.BI "                            const int *" files ","
.BI "                            unsigned " nr_files ");"
.PP
.BI "int io_uring_register_files_sparse(struct io_uring *" ring ","
.BI "                            unsigned " nr_files ");"
.fi
.SH DESCRIPTION
.PP
The
.BR io_uring_register_files (3)
function registers
.I nr_files
number of file descriptors defined by the array
.I files
belonging to the
.I ring
for subsequent operations.

The
.BR io_uring_register_files_sparse (3)
function registers an empty file table of
.I 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.

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.

.SH RETURN VALUE
On success
.BR io_uring_register_files (3)
and
.BR io_uring_register_files_sparse (3)
return 0. On failure they return
.BR -errno .
.SH SEE ALSO
.BR io_uring_get_sqe (3),
.BR io_uring_unregister_files (3)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
polyphony-0.98 vendor/liburing/man/io_uring_register_files.3
polyphony-0.97 vendor/liburing/man/io_uring_register_files.3
polyphony-0.96 vendor/liburing/man/io_uring_register_files.3
polyphony-0.95 vendor/liburing/man/io_uring_register_files.3