use crate::backend::c;
use libc_errno::errno;
#[repr(transparent)]
#[doc(alias = "errno")]
#[derive(Eq, PartialEq, Hash, Copy, Clone)]
pub struct Errno(pub(crate) c::c_int);
impl Errno {
#[doc(alias = "ACCES")]
pub const ACCESS: Self = Self(c::EACCES);
pub const ADDRINUSE: Self = Self(c::EADDRINUSE);
pub const ADDRNOTAVAIL: Self = Self(c::EADDRNOTAVAIL);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const ADV: Self = Self(c::EADV);
#[cfg(not(target_os = "l4re"))]
pub const AFNOSUPPORT: Self = Self(c::EAFNOSUPPORT);
pub const AGAIN: Self = Self(c::EAGAIN);
#[cfg(not(target_os = "l4re"))]
pub const ALREADY: Self = Self(c::EALREADY);
#[cfg(bsd)]
pub const AUTH: Self = Self(c::EAUTH);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const BADE: Self = Self(c::EBADE);
pub const BADF: Self = Self(c::EBADF);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const BADFD: Self = Self(c::EBADFD);
#[cfg(not(any(windows, target_os = "l4re")))]
pub const BADMSG: Self = Self(c::EBADMSG);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const BADR: Self = Self(c::EBADR);
#[cfg(bsd)]
pub const BADRPC: Self = Self(c::EBADRPC);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const BADRQC: Self = Self(c::EBADRQC);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const BADSLT: Self = Self(c::EBADSLT);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const BFONT: Self = Self(c::EBFONT);
#[cfg(not(windows))]
pub const BUSY: Self = Self(c::EBUSY);
#[cfg(not(target_os = "l4re"))]
pub const CANCELED: Self = Self(c::ECANCELED);
#[cfg(target_os = "freebsd")]
pub const CAPMODE: Self = Self(c::ECAPMODE);
#[cfg(not(windows))]
pub const CHILD: Self = Self(c::ECHILD);
#[cfg(not(any(
bsd,
windows,
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi"
)))]
pub const CHRNG: Self = Self(c::ECHRNG);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const COMM: Self = Self(c::ECOMM);
pub const CONNABORTED: Self = Self(c::ECONNABORTED);
pub const CONNREFUSED: Self = Self(c::ECONNREFUSED);
pub const CONNRESET: Self = Self(c::ECONNRESET);
#[cfg(not(windows))]
pub const DEADLK: Self = Self(c::EDEADLK);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "android",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "vita",
target_os = "wasi",
)))]
pub const DEADLOCK: Self = Self(c::EDEADLOCK);
#[cfg(not(target_os = "l4re"))]
pub const DESTADDRREQ: Self = Self(c::EDESTADDRREQ);
#[cfg(windows)]
pub const DISCON: Self = Self(c::EDISCON);
#[cfg(not(windows))]
pub const DOM: Self = Self(c::EDOM);
#[cfg(freebsdlike)]
pub const DOOFUS: Self = Self(c::EDOOFUS);
#[cfg(not(any(
bsd,
solarish,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "nto",
target_os = "vita",
target_os = "wasi",
)))]
pub const DOTDOT: Self = Self(c::EDOTDOT);
pub const DQUOT: Self = Self(c::EDQUOT);
#[cfg(not(windows))]
pub const EXIST: Self = Self(c::EEXIST);
pub const FAULT: Self = Self(c::EFAULT);
#[cfg(not(windows))]
pub const FBIG: Self = Self(c::EFBIG);
#[cfg(any(bsd, target_env = "newlib"))]
pub const FTYPE: Self = Self(c::EFTYPE);
#[cfg(not(any(target_os = "l4re", target_os = "wasi")))]
pub const HOSTDOWN: Self = Self(c::EHOSTDOWN);
pub const HOSTUNREACH: Self = Self(c::EHOSTUNREACH);
#[cfg(not(any(
bsd,
solarish,
windows,
target_os = "aix",
target_os = "android",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "nto",
target_os = "redox",
target_os = "vita",
target_os = "wasi",
)))]
pub const HWPOISON: Self = Self(c::EHWPOISON);
#[cfg(not(any(windows, target_os = "l4re")))]
pub const IDRM: Self = Self(c::EIDRM);
#[cfg(not(any(windows, target_os = "l4re")))]
pub const ILSEQ: Self = Self(c::EILSEQ);
#[cfg(not(target_os = "l4re"))]
pub const INPROGRESS: Self = Self(c::EINPROGRESS);
pub const INTR: Self = Self(c::EINTR);
pub const INVAL: Self = Self(c::EINVAL);
#[cfg(windows)]
pub const INVALIDPROCTABLE: Self = Self(c::EINVALIDPROCTABLE);
#[cfg(windows)]
pub const INVALIDPROVIDER: Self = Self(c::EINVALIDPROVIDER);
#[cfg(not(windows))]
pub const IO: Self = Self(c::EIO);
#[cfg(not(target_os = "l4re"))]
pub const ISCONN: Self = Self(c::EISCONN);
#[cfg(not(windows))]
pub const ISDIR: Self = Self(c::EISDIR);
#[cfg(not(any(
bsd,
solarish,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "nto",
target_os = "vita",
target_os = "wasi",
)))]
pub const ISNAM: Self = Self(c::EISNAM);
#[cfg(not(any(
bsd,
solarish,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "nto",
target_os = "vita",
target_os = "wasi",
)))]
pub const KEYEXPIRED: Self = Self(c::EKEYEXPIRED);
#[cfg(not(any(
bsd,
solarish,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "nto",
target_os = "vita",
target_os = "wasi",
)))]
pub const KEYREJECTED: Self = Self(c::EKEYREJECTED);
#[cfg(not(any(
bsd,
solarish,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "nto",
target_os = "vita",
target_os = "wasi",
)))]
pub const KEYREVOKED: Self = Self(c::EKEYREVOKED);
#[cfg(not(any(
bsd,
windows,
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi"
)))]
pub const L2HLT: Self = Self(c::EL2HLT);
#[cfg(not(any(
bsd,
windows,
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi"
)))]
pub const L2NSYNC: Self = Self(c::EL2NSYNC);
#[cfg(not(any(
bsd,
windows,
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi"
)))]
pub const L3HLT: Self = Self(c::EL3HLT);
#[cfg(not(any(
bsd,
windows,
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi"
)))]
pub const L3RST: Self = Self(c::EL3RST);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const LIBACC: Self = Self(c::ELIBACC);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const LIBBAD: Self = Self(c::ELIBBAD);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const LIBEXEC: Self = Self(c::ELIBEXEC);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const LIBMAX: Self = Self(c::ELIBMAX);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const LIBSCN: Self = Self(c::ELIBSCN);
#[cfg(not(any(
bsd,
windows,
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi"
)))]
pub const LNRNG: Self = Self(c::ELNRNG);
pub const LOOP: Self = Self(c::ELOOP);
#[cfg(not(any(
bsd,
solarish,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "nto",
target_os = "vita",
target_os = "wasi",
)))]
pub const MEDIUMTYPE: Self = Self(c::EMEDIUMTYPE);
pub const MFILE: Self = Self(c::EMFILE);
#[cfg(not(windows))]
pub const MLINK: Self = Self(c::EMLINK);
#[cfg(not(target_os = "l4re"))]
pub const MSGSIZE: Self = Self(c::EMSGSIZE);
#[cfg(not(any(windows, target_os = "l4re", target_os = "openbsd")))]
pub const MULTIHOP: Self = Self(c::EMULTIHOP);
pub const NAMETOOLONG: Self = Self(c::ENAMETOOLONG);
#[cfg(not(any(
bsd,
solarish,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "nto",
target_os = "vita",
target_os = "wasi",
)))]
pub const NAVAIL: Self = Self(c::ENAVAIL);
#[cfg(bsd)]
pub const NEEDAUTH: Self = Self(c::ENEEDAUTH);
pub const NETDOWN: Self = Self(c::ENETDOWN);
#[cfg(not(target_os = "l4re"))]
pub const NETRESET: Self = Self(c::ENETRESET);
pub const NETUNREACH: Self = Self(c::ENETUNREACH);
#[cfg(not(windows))]
pub const NFILE: Self = Self(c::ENFILE);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const NOANO: Self = Self(c::ENOANO);
#[cfg(any(bsd, target_os = "haiku"))]
pub const NOATTR: Self = Self(c::ENOATTR);
#[cfg(not(target_os = "l4re"))]
pub const NOBUFS: Self = Self(c::ENOBUFS);
#[cfg(not(any(
bsd,
windows,
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi"
)))]
pub const NOCSI: Self = Self(c::ENOCSI);
#[cfg(not(any(
freebsdlike,
windows,
target_os = "haiku",
target_os = "openbsd",
target_os = "wasi",
)))]
pub const NODATA: Self = Self(c::ENODATA);
#[cfg(not(windows))]
pub const NODEV: Self = Self(c::ENODEV);
#[cfg(not(windows))]
pub const NOENT: Self = Self(c::ENOENT);
#[cfg(not(windows))]
pub const NOEXEC: Self = Self(c::ENOEXEC);
#[cfg(not(any(
solarish,
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "nto",
target_os = "vita",
target_os = "wasi",
)))]
pub const NOKEY: Self = Self(c::ENOKEY);
#[cfg(not(any(windows, target_os = "l4re")))]
pub const NOLCK: Self = Self(c::ENOLCK);
#[cfg(not(any(windows, target_os = "l4re", target_os = "openbsd")))]
pub const NOLINK: Self = Self(c::ENOLINK);
#[cfg(not(any(
bsd,
solarish,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "nto",
target_os = "vita",
target_os = "wasi",
)))]
pub const NOMEDIUM: Self = Self(c::ENOMEDIUM);
#[cfg(not(windows))]
pub const NOMEM: Self = Self(c::ENOMEM);
#[cfg(windows)]
pub const NOMORE: Self = Self(c::ENOMORE);
#[cfg(not(any(windows, target_os = "l4re")))]
pub const NOMSG: Self = Self(c::ENOMSG);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const NONET: Self = Self(c::ENONET);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const NOPKG: Self = Self(c::ENOPKG);
#[cfg(not(target_os = "l4re"))]
pub const NOPROTOOPT: Self = Self(c::ENOPROTOOPT);
#[cfg(not(windows))]
pub const NOSPC: Self = Self(c::ENOSPC);
#[cfg(not(any(
freebsdlike,
windows,
target_os = "haiku",
target_os = "l4re",
target_os = "openbsd",
target_os = "wasi",
)))]
pub const NOSR: Self = Self(c::ENOSR);
#[cfg(not(any(
freebsdlike,
windows,
target_os = "haiku",
target_os = "l4re",
target_os = "openbsd",
target_os = "wasi",
)))]
pub const NOSTR: Self = Self(c::ENOSTR);
#[cfg(not(windows))]
pub const NOSYS: Self = Self(c::ENOSYS);
#[cfg(not(any(
windows,
target_os = "espidf",
target_os = "haiku",
target_os = "vita",
target_os = "wasi"
)))]
pub const NOTBLK: Self = Self(c::ENOTBLK);
#[cfg(any(target_os = "freebsd", target_os = "wasi"))]
pub const NOTCAPABLE: Self = Self(c::ENOTCAPABLE);
pub const NOTCONN: Self = Self(c::ENOTCONN);
#[cfg(not(windows))]
pub const NOTDIR: Self = Self(c::ENOTDIR);
pub const NOTEMPTY: Self = Self(c::ENOTEMPTY);
#[cfg(not(any(
bsd,
solarish,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "nto",
target_os = "vita",
target_os = "wasi",
)))]
pub const NOTNAM: Self = Self(c::ENOTNAM);
#[cfg(not(any(
freebsdlike,
netbsdlike,
windows,
target_os = "haiku",
target_os = "l4re"
)))]
pub const NOTRECOVERABLE: Self = Self(c::ENOTRECOVERABLE);
#[cfg(not(target_os = "l4re"))]
pub const NOTSOCK: Self = Self(c::ENOTSOCK);
#[cfg(not(any(windows, target_os = "haiku", target_os = "redox")))]
pub const NOTSUP: Self = Self(c::ENOTSUP);
#[cfg(not(windows))]
pub const NOTTY: Self = Self(c::ENOTTY);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const NOTUNIQ: Self = Self(c::ENOTUNIQ);
#[cfg(not(windows))]
pub const NXIO: Self = Self(c::ENXIO);
pub const OPNOTSUPP: Self = Self(c::EOPNOTSUPP);
#[cfg(not(any(windows, target_os = "l4re")))]
pub const OVERFLOW: Self = Self(c::EOVERFLOW);
#[cfg(not(any(
freebsdlike,
netbsdlike,
windows,
target_os = "haiku",
target_os = "l4re"
)))]
pub const OWNERDEAD: Self = Self(c::EOWNERDEAD);
#[cfg(not(windows))]
pub const PERM: Self = Self(c::EPERM);
#[cfg(not(any(target_os = "l4re", target_os = "wasi")))]
pub const PFNOSUPPORT: Self = Self(c::EPFNOSUPPORT);
#[cfg(not(windows))]
pub const PIPE: Self = Self(c::EPIPE);
#[cfg(bsd)]
pub const PROCLIM: Self = Self(c::EPROCLIM);
#[cfg(bsd)]
pub const PROCUNAVAIL: Self = Self(c::EPROCUNAVAIL);
#[cfg(bsd)]
pub const PROGMISMATCH: Self = Self(c::EPROGMISMATCH);
#[cfg(bsd)]
pub const PROGUNAVAIL: Self = Self(c::EPROGUNAVAIL);
#[cfg(not(any(windows, target_os = "l4re")))]
pub const PROTO: Self = Self(c::EPROTO);
#[cfg(not(target_os = "l4re"))]
pub const PROTONOSUPPORT: Self = Self(c::EPROTONOSUPPORT);
#[cfg(not(target_os = "l4re"))]
pub const PROTOTYPE: Self = Self(c::EPROTOTYPE);
#[cfg(windows)]
pub const PROVIDERFAILEDINIT: Self = Self(c::EPROVIDERFAILEDINIT);
#[cfg(not(windows))]
pub const RANGE: Self = Self(c::ERANGE);
#[cfg(windows)]
pub const REFUSED: Self = Self(c::EREFUSED);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const REMCHG: Self = Self(c::EREMCHG);
#[cfg(not(any(
target_os = "espidf",
target_os = "haiku",
target_os = "l4re",
target_os = "vita",
target_os = "wasi"
)))]
pub const REMOTE: Self = Self(c::EREMOTE);
#[cfg(not(any(
bsd,
solarish,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "nto",
target_os = "vita",
target_os = "wasi",
)))]
pub const REMOTEIO: Self = Self(c::EREMOTEIO);
#[cfg(not(any(
bsd,
windows,
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi"
)))]
pub const RESTART: Self = Self(c::ERESTART);
#[cfg(not(any(
bsd,
solarish,
windows,
target_os = "aix",
target_os = "android",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "nto",
target_os = "redox",
target_os = "vita",
target_os = "wasi",
)))]
pub const RFKILL: Self = Self(c::ERFKILL);
#[cfg(not(windows))]
pub const ROFS: Self = Self(c::EROFS);
#[cfg(bsd)]
pub const RPCMISMATCH: Self = Self(c::ERPCMISMATCH);
#[cfg(not(any(
target_os = "espidf",
target_os = "l4re",
target_os = "vita",
target_os = "wasi"
)))]
pub const SHUTDOWN: Self = Self(c::ESHUTDOWN);
#[cfg(not(any(
target_os = "espidf",
target_os = "haiku",
target_os = "l4re",
target_os = "vita",
target_os = "wasi"
)))]
pub const SOCKTNOSUPPORT: Self = Self(c::ESOCKTNOSUPPORT);
#[cfg(not(windows))]
pub const SPIPE: Self = Self(c::ESPIPE);
#[cfg(not(windows))]
pub const SRCH: Self = Self(c::ESRCH);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const SRMNT: Self = Self(c::ESRMNT);
pub const STALE: Self = Self(c::ESTALE);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const STRPIPE: Self = Self(c::ESTRPIPE);
#[cfg(not(any(
freebsdlike,
windows,
target_os = "l4re",
target_os = "openbsd",
target_os = "wasi"
)))]
pub const TIME: Self = Self(c::ETIME);
pub const TIMEDOUT: Self = Self(c::ETIMEDOUT);
#[cfg(not(windows))]
#[doc(alias = "2BIG")]
pub const TOOBIG: Self = Self(c::E2BIG);
#[cfg(not(any(target_os = "haiku", target_os = "l4re", target_os = "wasi")))]
pub const TOOMANYREFS: Self = Self(c::ETOOMANYREFS);
#[cfg(not(windows))]
pub const TXTBSY: Self = Self(c::ETXTBSY);
#[cfg(not(any(
bsd,
solarish,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "nto",
target_os = "vita",
target_os = "wasi",
)))]
pub const UCLEAN: Self = Self(c::EUCLEAN);
#[cfg(not(any(
bsd,
windows,
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi"
)))]
pub const UNATCH: Self = Self(c::EUNATCH);
#[cfg(not(any(
target_os = "espidf",
target_os = "haiku",
target_os = "l4re",
target_os = "vita",
target_os = "wasi"
)))]
pub const USERS: Self = Self(c::EUSERS);
pub const WOULDBLOCK: Self = Self(c::EWOULDBLOCK);
#[cfg(not(windows))]
pub const XDEV: Self = Self(c::EXDEV);
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "hurd",
target_os = "l4re",
target_os = "vita",
target_os = "wasi",
)))]
pub const XFULL: Self = Self(c::EXFULL);
}
impl Errno {
#[cfg(feature = "std")]
#[inline]
pub fn from_io_error(io_err: &std::io::Error) -> Option<Self> {
io_err
.raw_os_error()
.and_then(|raw| if raw != 0 { Some(Self(raw)) } else { None })
}
#[inline]
pub const fn raw_os_error(self) -> i32 {
self.0
}
#[inline]
pub const fn from_raw_os_error(raw: i32) -> Self {
Self(raw)
}
pub(crate) fn last_os_error() -> Self {
Self(errno().0)
}
}