1io_uring_close_ring_fd(3) liburing Manual io_uring_close_ring_fd(3)
2
3
4
6 io_uring_close_ring_fd - close a ring file descriptor and use it only
7 via registered index
8
10 #include <liburing.h>
11
12 int io_uring_close_ring_fd(struct io_uring *ring);
13
15 io_uring_close_ring_fd(3) closes the ring file descriptor, which must
16 have been previously registered. The file will remain open, but acces‐
17 sible only via the registered index, not via any file descriptor. Sub‐
18 sequent liburing calls will continue to work, using the registered ring
19 fd.
20
21 The kernel must support IORING_FEAT_REG_REG_RING.
22
23 Libraries that must avoid disrupting their users' uses of file descrip‐
24 tors, and must continue working even in the face of close_range(2) and
25 similar, can use io_uring_close_ring_fd(3) to work with liburing with‐
26 out having any open file descriptor.
27
28
30 Each thread that wants to make use of io_uring must register the fd. A
31 library that may get called from arbitrary theads may need to detect
32 when it gets called on a previously unseen thread and create and regis‐
33 ter a ring for that thread.
34
36 Returns 1 on success, or -errno on error.
37
39 io_uring_register_ring_fd(3)
40
41
42
43liburing-2.4 September 25, 2022 io_uring_close_ring_fd(3)