tokio/io/uring/
utils.rs

1use std::os::fd::AsRawFd;
2use std::os::unix::ffi::OsStrExt;
3use std::sync::Arc;
4use std::{ffi::CString, io, path::Path};
5
6pub(crate) type ArcFd = Arc<dyn AsRawFd + Send + Sync + 'static>;
7
8pub(crate) fn cstr(p: &Path) -> io::Result<CString> {
9    Ok(CString::new(p.as_os_str().as_bytes())?)
10}