1io_uring_prep_write(3)          liburing Manual         io_uring_prep_write(3)
2
3
4

NAME

6       io_uring_prep_write - prepare I/O write request
7

SYNOPSIS

9       #include <liburing.h>
10
11       void io_uring_prep_write(struct io_uring_sqe *sqe,
12                                int fd,
13                                const void *buf,
14                                unsigned nbytes,
15                                __u64 offset);
16

DESCRIPTION

18       The io_uring_prep_write(3) prepares an IO write request. The submission
19       queue entry sqe is setup to use the file descriptor fd to start writing
20       nbytes from the buffer buf at the specified offset.
21
22       On  files  that  support seeking, if the offset is set to -1, the write
23       operation commences at the file offset, and the file offset  is  incre‐
24       mented  by  the number of bytes written. See write(2) for more details.
25       Note that for an async API, reading and updating the current file  off‐
26       set  may result in unpredictable behavior, unless access to the file is
27       serialized. It is not encouraged to use this feature if  it's  possible
28       to 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 write has been prepared, it can be submitted with one of the
33       submit functions.
34
35

RETURN VALUE

37       None
38

ERRORS

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

SEE ALSO

47       io_uring_get_sqe(3), io_uring_submit(3)
48
49
50
51liburing-2.1                   November 15, 2021        io_uring_prep_write(3)
Impressum