pub fn openat(
dir_res: &impl AsResource,
path: CString,
flags: i32,
) -> Io<OpenAt>Expand description
Opens a file relative to a directory file descriptor.
Equivalent to the openat(2) syscall.
ยงExamples
use std::ffi::CString;
async fn openat_example() -> std::io::Result<()> {
let path = CString::new("/tmp/test.txt").unwrap();
let fd = lio::api::openat(&dir, path, libc::O_RDONLY).await?;
println!("Opened file: {:?}", fd);
Ok(())
}