aboutsummaryrefslogtreecommitdiff
path: root/man/io_uring_register_files.3
blob: 0a9ccc3484a62bcf072fb33bab3c57244b670c4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
.\" 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.

.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)