cap_primitives/rustix/fs/
errors.rs

1use std::io;
2
3#[cfg(any(target_os = "android", target_os = "linux"))]
4#[cold]
5pub(crate) fn invalid_flags() -> io::Error {
6    rustix::io::Errno::INVAL.into()
7}
8
9#[cold]
10pub(crate) fn no_such_file_or_directory() -> io::Error {
11    rustix::io::Errno::NOENT.into()
12}
13
14#[cold]
15pub(crate) fn is_directory() -> io::Error {
16    rustix::io::Errno::ISDIR.into()
17}
18
19#[cold]
20pub(crate) fn is_not_directory() -> io::Error {
21    rustix::io::Errno::NOTDIR.into()
22}
23
24#[cold]
25pub(crate) fn too_many_symlinks() -> io::Error {
26    rustix::io::Errno::LOOP.into()
27}