io-uring: ensure that timeouts are encoded in the same submission
This commit is contained in:
parent
7cc6c945d3
commit
4780315f50
5 changed files with 35 additions and 18 deletions
|
|
@ -2,7 +2,7 @@ use {
|
|||
crate::{
|
||||
io_uring::{
|
||||
pending_result::PendingResult,
|
||||
sys::{io_uring_sqe, IORING_OP_SENDMSG, IOSQE_IO_LINK},
|
||||
sys::{io_uring_sqe, IORING_OP_SENDMSG},
|
||||
IoUring, IoUringData, IoUringError, Task,
|
||||
},
|
||||
time::Time,
|
||||
|
|
@ -123,8 +123,9 @@ unsafe impl Task for SendmsgTask {
|
|||
sqe.fd = self.fd;
|
||||
sqe.u2.addr = &self.msghdr as *const _ as _;
|
||||
sqe.u3.msg_flags = c::MSG_NOSIGNAL as _;
|
||||
if self.has_timeout {
|
||||
sqe.flags = IOSQE_IO_LINK;
|
||||
}
|
||||
}
|
||||
|
||||
fn has_timeout(&self) -> bool {
|
||||
self.has_timeout
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue