Lines Matching full:stat
22 cwd, fstat, fstatfs, major, openat, renameat, Dir, FileType, Mode, OFlags, Stat,
49 proc_stat: Option<&Stat>, in check_proc_entry() argument
50 ) -> io::Result<Stat> { in check_proc_entry() argument
55 /// Check a subdirectory of "/proc" for anomalies, using the provided `Stat`.
59 entry_stat: Stat, in check_proc_entry_with_stat() argument
60 proc_stat: Option<&Stat>, in check_proc_entry_with_stat() argument
61 ) -> io::Result<Stat> { in check_proc_entry_with_stat() argument
105 fn check_proc_root(entry: BorrowedFd<'_>, stat: &Stat) -> io::Result<()> { in check_proc_root()
108 assert_eq!(FileType::from_raw_mode(stat.st_mode), FileType::Directory); in check_proc_root()
111 if stat.st_ino != PROC_ROOT_INO { in check_proc_root()
117 if major(stat.st_dev) != 0 { in check_proc_root()
131 stat: &Stat, in check_proc_subdir() argument
132 proc_stat: Option<&Stat>, in check_proc_subdir() argument
136 assert_eq!(FileType::from_raw_mode(stat.st_mode), FileType::Directory); in check_proc_subdir()
138 check_proc_nonroot(stat, proc_stat)?; in check_proc_subdir()
148 fn check_proc_file(stat: &Stat, proc_stat: Option<&Stat>) -> io::Result<()> { in check_proc_file() argument
150 if FileType::from_raw_mode(stat.st_mode) != FileType::RegularFile { in check_proc_file()
154 check_proc_nonroot(stat, proc_stat)?; in check_proc_file()
159 fn check_proc_nonroot(stat: &Stat, proc_stat: Option<&Stat>) -> io::Result<()> { in check_proc_nonroot() argument
161 if stat.st_ino == PROC_ROOT_INO { in check_proc_nonroot()
166 if stat.st_dev != proc_stat.unwrap().st_dev { in check_proc_nonroot()
207 /// and that it looks normal. It also returns the `Stat` of `/proc`.
213 fn proc() -> io::Result<(BorrowedFd<'static>, &'static Stat)> { in proc()
227 .map(|(fd, stat)| (fd.as_fd(), stat)) in proc()
233 /// it, and that it looks normal. It also returns the `Stat` of `/proc/self`.
239 fn proc_self() -> io::Result<(BorrowedFd<'static>, &'static Stat)> { in proc_self()
257 .map(|(owned, stat)| (owned.as_fd(), stat)) in proc_self()
291 type StaticFd = OnceCell<(OwnedFd, Stat)>;
294 fn new_static_fd(fd: OwnedFd, stat: Stat) -> (OwnedFd, Stat) { in new_static_fd() argument
295 (fd, stat) in new_static_fd()
301 /// on top of it, and that it looks normal. It also returns the `Stat` of
308 fn proc_self_fdinfo() -> io::Result<(BorrowedFd<'static>, &'static Stat)> { in proc_self_fdinfo()
325 .map(|(owned, stat)| (owned.as_fd(), stat)) in proc_self_fdinfo()
403 fn open_and_check_file(dir: BorrowedFd, dir_stat: &Stat, name: &CStr) -> io::Result<OwnedFd> { in open_and_check_file() argument
432 let dot_stat = dir.stat().map_err(|_err| io::Errno::NOTSUP)?; in open_and_check_file()