1io_uring_prep_sendmsg(3) liburing Manual io_uring_prep_sendmsg(3)
2
3
4
6 io_uring_prep_sendmsg - prepare a sendmsg request
7
9 #include <sys/types.h>
10 #include <sys/socket.h>
11 #include <liburing.h>
12
13 void io_uring_prep_sendmsg(struct io_uring_sqe *sqe,
14 int fd,
15 const struct msghdr *msg,
16 unsigned flags);
17
18 void io_uring_prep_sendmsg_zc(struct io_uring_sqe *sqe,
19 int fd,
20 const struct msghdr *msg,
21 unsigned flags);
22
24 The io_uring_prep_sendmsg(3) function prepares a sendmsg request. The
25 submission queue entry sqe is setup to use the file descriptor fd to
26 start sending the data indicated by msg with the sendmsg(2) defined
27 flags in the flags argument.
28
29 The io_uring_prep_sendmsg_zc(3) accepts the same parameters as io_ur‐
30 ing_prep_sendmsg(3) but prepares a zerocopy sendmsg request.
31
32 Note that using IOSQE_IO_LINK with this request type requires the set‐
33 ting of MSG_WAITALL in the flags argument, as a short send isn't con‐
34 sidered an error condition without that being set.
35
36 This function prepares an async sendmsg(2) request. See that man page
37 for details.
38
39
41 None
42
44 The CQE res field will contain the result of the operation. See the re‐
45 lated man page for details on possible values. Note that where synchro‐
46 nous system calls will return -1 on failure and set errno to the actual
47 error value, io_uring never uses errno. Instead it returns the negated
48 errno directly in the CQE res field.
49
51 As with any request that passes in data in a struct, that data must re‐
52 main valid until the request has been successfully submitted. It need
53 not remain valid until completion. Once a request has been submitted,
54 the in-kernel state is stable. Very early kernels (5.4 and earlier) re‐
55 quired state to be stable until the completion occurred. Applications
56 can test for this behavior by inspecting the IORING_FEAT_SUBMIT_STABLE
57 flag passed back from io_uring_queue_init_params(3).
58
60 io_uring_get_sqe(3), io_uring_submit(3), sendmsg(2)
61
62
63
64liburing-2.2 March 12, 2022 io_uring_prep_sendmsg(3)