1io_uring_prep_read(3) liburing Manual io_uring_prep_read(3)
2
3
4
6 io_uring_prep_read - prepare I/O read request
7
9 #include <liburing.h>
10
11 void io_uring_prep_read(struct io_uring_sqe *sqe,
12 int fd,
13 void *buf,
14 unsigned nbytes,
15 __u64 offset);
16
18 The io_uring_prep_read(3) prepares an IO read request. The submission
19 queue entry sqe is setup to use the file descriptor fd to start reading
20 nbytes into the buffer buf at the specified offset.
21
22 On files that support seeking, if the offset is set to -1, the read op‐
23 eration commences at the file offset, and the file offset is incre‐
24 mented by the number of bytes read. See read(2) for more details. Note
25 that for an async API, reading and updating the current file offset may
26 result in unpredictable behavior, unless access to the file is serial‐
27 ized. It is not encouraged to use this feature, if it's possible to
28 provide the desired IO offset from the application or library.
29
30 On files that are not capable of seeking, the offset must be 0 or -1.
31
32 After the read has been prepared it can be submitted with one of the
33 submit functions.
34
35
37 None
38
40 The CQE res field will contain the result of the operation. See the re‐
41 lated man page for details on possible values. Note that where synchro‐
42 nous system calls will return -1 on failure and set errno to the actual
43 error value, io_uring never uses errno. Instead it returns the negated
44 errno directly in the CQE res field.
45
47 io_uring_get_sqe(3), io_uring_prep_readv(3), io_uring_prep_readv2(3),
48 io_uring_submit(3)
49
50
51
52liburing-2.1 November 15, 2021 io_uring_prep_read(3)