You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My IO layer is built around io_uring, where multishot results gives access to control messages buffer as raw bytes and it is up to the app to parse it.
I could get by with libc to iterate over headers:
let hdr: RecvMsgOut = io_uring::types::RecvMsgOut::parse(buf)?;
// Fake msghdr to iterate over control messages
let mut mhdr = new_msghdr();
mhdr.msg_controllen = hdr.control_data().len() as _;
mhdr.msg_control = hdr.control_data().as_ptr() as _;
// SAFETY: msghdr.msg_controllen and msghdr.msg_control are valid
unsafe {
let mut cmsghdr = libc::CMSG_FIRSTHDR(std::ptr::addr_of!(mhdr));
while !cmsghdr.is_null() {
let cmsg = &*cmsghdr;
// ControlMessageOwned::decode_from();
cmsghdr = libc::CMSG_NXTHDR(&mhdr as *const _, cmsghdr);
}
}
but interpreting each header remains fairly low level. This crate contains most complete ergonomic handler for each individual control message type I could find, but it doesn't expose it publically. Maybe you could change ControlMessageOwned::decode_from to pub?
The text was updated successfully, but these errors were encountered:
My IO layer is built around io_uring, where multishot results gives access to control messages buffer as raw bytes and it is up to the app to parse it.
I could get by with
libc
to iterate over headers:but interpreting each header remains fairly low level. This crate contains most complete ergonomic handler for each individual control message type I could find, but it doesn't expose it publically. Maybe you could change
ControlMessageOwned::decode_from
topub
?The text was updated successfully, but these errors were encountered: