/rust/registry/src/index.crates.io-6f17d22bba15001f/rustix-0.37.13/src/fs/openat2.rs
Line | Count | Source (jump to first uncovered line) |
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 | | /// |
8 | | /// # References |
9 | | /// - [Linux] |
10 | | /// |
11 | | /// [Linux]: https://man7.org/linux/man-pages/man2/openat2.2.html |
12 | | #[inline] |
13 | 0 | pub fn openat2<Fd: AsFd, P: path::Arg>( |
14 | 0 | dirfd: Fd, |
15 | 0 | path: P, |
16 | 0 | oflags: OFlags, |
17 | 0 | mode: Mode, |
18 | 0 | resolve: ResolveFlags, |
19 | 0 | ) -> io::Result<OwnedFd> { |
20 | 0 | path.into_with_c_str(|path| { |
21 | 0 | backend::fs::syscalls::openat2(dirfd.as_fd(), path, oflags, mode, resolve) |
22 | 0 | }) |
23 | 0 | } |