Lines Matching refs:file
149 // Check that we have a regular file.
173 /// Check that `file` is opened on a `procfs` filesystem.
174 fn check_procfs(file: BorrowedFd<'_>) -> io::Result<()> {
175 let statfs = fstatfs(file)?;
187 fn is_mountpoint(file: BorrowedFd<'_>) -> bool {
188 let err = renameat(file, cstr!("../."), file, cstr!(".")).unwrap_err();
328 /// Returns a handle to a Linux `/proc/self/fdinfo/<fd>` file.
349 /// Returns a handle to a Linux `/proc/self/pagemap` file.
366 /// Returns a handle to a Linux `/proc/self/maps` file.
381 /// Returns a handle to a Linux `/proc/self/status` file.
396 /// Open a file under `/proc/self`.
402 /// Open a procfs file within in `dir` and check it for bind mounts.
406 // Don't use `NOATIME`, because it [requires us to own the file], and when
410 // [requires us to own the file]: https://man7.org/linux/man-pages/man2/openat.2.html
413 let file = openat(dir, name, oflags, Mode::empty()).map_err(|_err| io::Errno::NOTSUP)?;
414 let file_stat = fstat(&file)?;
416 // `is_mountpoint` only works on directory mount points, not file mount
417 // points. To detect file mount points, scan the parent directory to see
418 // if we can find a regular file with an inode and name that matches the
419 // file we just opened. If we can't find it, there could be a file bind
420 // mount on top of the file we want.
445 // We found the file. Proceed to check the file handle.
447 check_proc_entry_with_stat(Kind::File, file.as_fd(), file_stat, Some(proc_stat))?;
460 Ok(file)