Coverage Report

Created: 2025-10-28 06:16

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/rustix-1.1.2/src/fs/openat2.rs
Line
Count
Source
1
use crate::fd::OwnedFd;
2
use crate::{backend, io, path};
3
use backend::fd::AsFd;
4
use backend::fs::types::{Mode, OFlags, ResolveFlags};
5
6
/// `openat2(dirfd, path, OpenHow { oflags, mode, resolve }, sizeof(OpenHow))`—
7
/// Opens a file with more options.
8
///
9
/// # References
10
///  - [Linux]
11
///
12
/// [Linux]: https://man7.org/linux/man-pages/man2/openat2.2.html
13
#[inline]
14
489k
pub fn openat2<Fd: AsFd, P: path::Arg>(
15
489k
    dirfd: Fd,
16
489k
    path: P,
17
489k
    oflags: OFlags,
18
489k
    mode: Mode,
19
489k
    resolve: ResolveFlags,
20
489k
) -> io::Result<OwnedFd> {
21
489k
    path.into_with_c_str(|path| {
22
489k
        backend::fs::syscalls::openat2(dirfd.as_fd(), path, oflags, mode, resolve)
23
489k
    })
rustix::fs::openat2::openat2::<&std::fs::File, &core::ffi::c_str::CStr>::{closure#0}
Line
Count
Source
21
489k
    path.into_with_c_str(|path| {
22
489k
        backend::fs::syscalls::openat2(dirfd.as_fd(), path, oflags, mode, resolve)
23
489k
    })
Unexecuted instantiation: rustix::fs::openat2::openat2::<_, _>::{closure#0}
24
489k
}
rustix::fs::openat2::openat2::<&std::fs::File, &core::ffi::c_str::CStr>
Line
Count
Source
14
489k
pub fn openat2<Fd: AsFd, P: path::Arg>(
15
489k
    dirfd: Fd,
16
489k
    path: P,
17
489k
    oflags: OFlags,
18
489k
    mode: Mode,
19
489k
    resolve: ResolveFlags,
20
489k
) -> io::Result<OwnedFd> {
21
489k
    path.into_with_c_str(|path| {
22
        backend::fs::syscalls::openat2(dirfd.as_fd(), path, oflags, mode, resolve)
23
    })
24
489k
}
Unexecuted instantiation: rustix::fs::openat2::openat2::<_, _>