use crate::syscalls::Errno;
pub const EPERM: Errno = 1;
pub const ENOENT: Errno = 2;
pub const ESRCH: Errno = 3;
pub const EINTR: Errno = 4;
pub const EIO: Errno = 5;
pub const ENXIO: Errno = 6;
pub const E2BIG: Errno = 7;
pub const ENOEXEC: Errno = 8;
pub const EBADF: Errno = 9;
pub const ECHILD: Errno = 10;
pub const EAGAIN: Errno = 11;
pub const ENOMEM: Errno = 12;
pub const EACCES: Errno = 13;
pub const EFAULT: Errno = 14;
pub const ENOTBLK: Errno = 15;
pub const EBUSY: Errno = 16;
pub const EEXIST: Errno = 17;
pub const EXDEV: Errno = 18;
pub const ENODEV: Errno = 19;
pub const ENOTDIR: Errno = 20;
pub const EISDIR: Errno = 21;
pub const EINVAL: Errno = 22;
pub const ENFILE: Errno = 23;
pub const EMFILE: Errno = 24;
pub const ENOTTY: Errno = 25;
pub const ETXTBSY: Errno = 26;
pub const EFBIG: Errno = 27;
pub const ENOSPC: Errno = 28;
pub const ESPIPE: Errno = 29;
pub const EROFS: Errno = 30;
pub const EMLINK: Errno = 31;
pub const EPIPE: Errno = 32;
pub const EDOM: Errno = 33;
pub const ERANGE: Errno = 34;
pub const EDEADLK: Errno = 35;
pub const ENAMETOOLONG: Errno = 36;
pub const ENOLCK: Errno = 37;
pub const ENOSYS: Errno = 38;
pub const ENOTEMPTY: Errno = 39;
pub const ELOOP: Errno = 40;
pub const EWOULDBLOCK: Errno = EAGAIN;
pub const ENOMSG: Errno = 42;
pub const EIDRM: Errno = 43;
pub const ECHRNG: Errno = 44;
pub const EL2NSYNC: Errno = 45;
pub const EL3HLT: Errno = 46;
pub const EL3RST: Errno = 47;
pub const ELNRNG: Errno = 48;
pub const EUNATCH: Errno = 49;
pub const ENOCSI: Errno = 50;
pub const EL2HLT: Errno = 51;
pub const EBADE: Errno = 52;
pub const EBADR: Errno = 53;
pub const EXFULL: Errno = 54;
pub const ENOANO: Errno = 55;
pub const EBADRQC: Errno = 56;
pub const EBADSLT: Errno = 57;
pub const EDEADLOCK: Errno = EDEADLK;
pub const EBFONT: Errno = 59;
pub const ENOSTR: Errno = 60;
pub const ENODATA: Errno = 61;
pub const ETIME: Errno = 62;
pub const ENOSR: Errno = 63;
pub const ENONET: Errno = 64;
pub const ENOPKG: Errno = 65;
pub const EREMOTE: Errno = 66;
pub const ENOLINK: Errno = 67;
pub const EADV: Errno = 68;
pub const ESRMNT: Errno = 69;
pub const ECOMM: Errno = 70;
pub const EPROTO: Errno = 71;
pub const EMULTIHOP: Errno = 72;
pub const EDOTDOT: Errno = 73;
pub const EBADMSG: Errno = 74;
pub const EOVERFLOW: Errno = 75;
pub const ENOTUNIQ: Errno = 76;
pub const EBADFD: Errno = 77;
pub const EREMCHG: Errno = 78;
pub const ELIBACC: Errno = 79;
pub const ELIBBAD: Errno = 80;
pub const ELIBSCN: Errno = 81;
pub const ELIBMAX: Errno = 82;
pub const ELIBEXEC: Errno = 83;
pub const EILSEQ: Errno = 84;
pub const ERESTART: Errno = 85;
pub const ESTRPIPE: Errno = 86;
pub const EUSERS: Errno = 87;
pub const ENOTSOCK: Errno = 88;
pub const EDESTADDRREQ: Errno = 89;
pub const EMSGSIZE: Errno = 90;
pub const EPROTOTYPE: Errno = 91;
pub const ENOPROTOOPT: Errno = 92;
pub const EPROTONOSUPPORT: Errno = 93;
pub const ESOCKTNOSUPPORT: Errno = 94;
pub const EOPNOTSUPP: Errno = 95;
pub const EPFNOSUPPORT: Errno = 96;
pub const EAFNOSUPPORT: Errno = 97;
pub const EADDRINUSE: Errno = 98;
pub const EADDRNOTAVAIL: Errno = 99;
pub const ENETDOWN: Errno = 100;
pub const ENETUNREACH: Errno = 101;
pub const ENETRESET: Errno = 102;
pub const ECONNABORTED: Errno = 103;
pub const ECONNRESET: Errno = 104;
pub const ENOBUFS: Errno = 105;
pub const EISCONN: Errno = 106;
pub const ENOTCONN: Errno = 107;
pub const ESHUTDOWN: Errno = 108;
pub const ETOOMANYREFS: Errno = 109;
pub const ETIMEDOUT: Errno = 110;
pub const ECONNREFUSED: Errno = 111;
pub const EHOSTDOWN: Errno = 112;
pub const EHOSTUNREACH: Errno = 113;
pub const EALREADY: Errno = 114;
pub const EINPROGRESS: Errno = 115;
pub const ESTALE: Errno = 116;
pub const EUCLEAN: Errno = 117;
pub const ENOTNAM: Errno = 118;
pub const ENAVAIL: Errno = 119;
pub const EISNAM: Errno = 120;
pub const EREMOTEIO: Errno = 121;
pub const EDQUOT: Errno = 122;
pub const ENOMEDIUM: Errno = 123;
pub const EMEDIUMTYPE: Errno = 124;
pub const ECANCELED: Errno = 125;
pub const ENOKEY: Errno = 126;
pub const EKEYEXPIRED: Errno = 127;
pub const EKEYREVOKED: Errno = 128;
pub const EKEYREJECTED: Errno = 129;
pub const EOWNERDEAD: Errno = 130;
pub const ENOTRECOVERABLE: Errno = 131;
pub const ERFKILL: Errno = 132;
pub const EHWPOISON: Errno = 133;
#[must_use]
#[allow(clippy::too_many_lines)]
pub const fn strerror(errno: Errno) -> &'static str {
match errno {
EPERM => "Operation not permitted",
ENOENT => "No such file or directory",
ESRCH => "No such process",
EINTR => "Interrupted system call",
EIO => "I/O error",
ENXIO => "No such device or address",
E2BIG => "Argument list too long",
ENOEXEC => "Exec format error",
EBADF => "Bad file number",
ECHILD => "No child processes",
EAGAIN => "Try again",
ENOMEM => "Out of memory",
EACCES => "Permission denied",
EFAULT => "Bad address",
ENOTBLK => "Block device required",
EBUSY => "Device or resource busy",
EEXIST => "File exists",
EXDEV => "Cross-device link",
ENODEV => "No such device",
ENOTDIR => "Not a directory",
EISDIR => "Is a directory",
EINVAL => "Invalid argument",
ENFILE => "File table overflow",
EMFILE => "Too many open files",
ENOTTY => "Not a typewriter",
ETXTBSY => "Text file busy",
EFBIG => "File too large",
ENOSPC => "No space left on device",
ESPIPE => "Illegal seek",
EROFS => "Read-only file system",
EMLINK => "Too many links",
EPIPE => "Broken pipe",
EDOM => "Math argument out of domain of func",
ERANGE => "Math result not representable",
EDEADLK => "Resource deadlock would occur",
ENAMETOOLONG => "File name too long",
ENOLCK => "No record locks available",
ENOSYS => "Invalid system call number",
ENOTEMPTY => "Directory not empty",
ELOOP => "Too many symbolic links encountered",
ENOMSG => "No message of desired type",
EIDRM => "Identifier removed",
ECHRNG => "Channel number out of range",
EL2NSYNC => "Level 2 not synchronized",
EL3HLT => "Level 3 halted",
EL3RST => "Level 3 reset",
ELNRNG => "Link number out of range",
EUNATCH => "Protocol driver not attached",
ENOCSI => "No CSI structure available",
EL2HLT => "Level 2 halted",
EBADE => "Invalid exchange",
EBADR => "Invalid request descriptor",
EXFULL => "Exchange full",
ENOANO => "No anode",
EBADRQC => "Invalid request code",
EBADSLT => "Invalid slot",
EBFONT => "Bad font file format",
ENOSTR => "Device not a stream",
ENODATA => "No data available",
ETIME => "Timer expired",
ENOSR => "Out of streams resources",
ENONET => "Machine is not on the network",
ENOPKG => "Package not installed",
EREMOTE => "Object is remote",
ENOLINK => "Link has been severed",
EADV => "Advertise error",
ESRMNT => "Srmount error",
ECOMM => "Communication error on send",
EPROTO => "Protocol error",
EMULTIHOP => "Multihop attempted",
EDOTDOT => "RFS specific error",
EBADMSG => "Not a data message",
EOVERFLOW => "Value too large for defined data type",
ENOTUNIQ => "Name not unique on network",
EBADFD => "File descriptor in bad state",
EREMCHG => "Remote address changed",
ELIBACC => "Can not access a needed shared library",
ELIBBAD => "Accessing a corrupted shared library",
ELIBSCN => ".lib section in a.out corrupted",
ELIBMAX => "Attempting to link in too many shared libraries",
ELIBEXEC => "Cannot exec a shared library directly",
EILSEQ => "Illegal byte sequence",
ERESTART => "Interrupted system call should be restarted",
ESTRPIPE => "Streams pipe error",
EUSERS => "Too many users",
ENOTSOCK => "Socket operation on non-socket",
EDESTADDRREQ => "Destination address required",
EMSGSIZE => "Message too long",
EPROTOTYPE => "Protocol wrong type for socket",
ENOPROTOOPT => "Protocol not available",
EPROTONOSUPPORT => "Protocol not supported",
ESOCKTNOSUPPORT => "Socket type not supported",
EOPNOTSUPP => "Operation not supported on transport endpoint",
EPFNOSUPPORT => "Protocol family not supported",
EAFNOSUPPORT => "Address family not supported by protocol",
EADDRINUSE => "Address already in use",
EADDRNOTAVAIL => "Cannot assign requested address",
ENETDOWN => "Network is down",
ENETUNREACH => "Network is unreachable",
ENETRESET => "Network dropped connection because of reset",
ECONNABORTED => "Software caused connection abort",
ECONNRESET => "Connection reset by peer",
ENOBUFS => "No buffer space available",
EISCONN => "Transport endpoint is already connected",
ENOTCONN => "Transport endpoint is not connected",
ESHUTDOWN => "Cannot send after transport endpoint shutdown",
ETOOMANYREFS => "Too many references: cannot splice",
ETIMEDOUT => "Connection timed out",
ECONNREFUSED => "Connection refused",
EHOSTDOWN => "Host is down",
EHOSTUNREACH => "No route to host",
EALREADY => "Operation already in progress",
EINPROGRESS => "Operation now in progress",
ESTALE => "Stale file handle",
EUCLEAN => "Structure needs cleaning",
ENOTNAM => "Not a XENIX named type file",
ENAVAIL => "No XENIX semaphores available",
EISNAM => "Is a named type file",
EREMOTEIO => "Remote I/O error",
EDQUOT => "Quota exceeded",
ENOMEDIUM => "No medium found",
EMEDIUMTYPE => "Wrong medium type",
ECANCELED => "Operation Canceled",
ENOKEY => "Required key not available",
EKEYEXPIRED => "Key has expired",
EKEYREVOKED => "Key has been revoked",
EKEYREJECTED => "Key was rejected by service",
EOWNERDEAD => "Owner died",
ENOTRECOVERABLE => "State not recoverable",
ERFKILL => "Operation not possible due to RF-kill",
EHWPOISON => "Memory page has hardware error",
_ => "Unknown errno!",
}
}