nix-errno-codes
Version:
Constants enumerating POSIX/Linux errno.h error codes.
267 lines (263 loc) • 9.04 kB
text/typescript
export const CODES = {
E2BIG: 'E2BIG',
ECCES: 'EACCES',
EADDRINUSE: 'EADDRINUSE',
EADDRNOTAVAIL: 'EADDRNOTAVAIL',
EAFNOSUPPORT: 'EAFNOSUPPORT',
EAGAIN: 'EAGAIN',
EALREADY: 'EALREADY',
EBADE: 'EBADE',
EBADF: 'EBADF',
EBADFD: 'EBADFD',
EBADMSG: 'EBADMSG',
EBADR: 'EBADR',
EBADRQC: 'EBADRQC',
EBADSLT: 'EBADSLT',
EBUSY: 'EBUSY',
ECANCELED: 'ECANCELED',
ECHILD: 'ECHILD',
ECHRNG: 'ECHRNG',
ECOMM: 'ECOMM',
ECONNABORTED: 'ECONNABORTED',
ECONNREFUSED: 'ECONNREFUSED',
ECONNRESET: 'ECONNRESET',
EDEADLK: 'EDEADLK',
EDEADLOCK: 'EDEADLOCK',
EDESTADDRREQ: 'EDESTADDRREQ',
EDOM: 'EDOM',
EDQUOT: 'EDQUOT',
EEXIST: 'EEXIST',
EFAULT: 'EFAULT',
EFBIG: 'EFBIG',
EHOSTDOWN: 'EHOSTDOWN',
EHOSTUNREACH: 'EHOSTUNREACH',
EHWPOISON: 'EHWPOISON',
EIDRM: 'EIDRM',
EILSEQ: 'EILSEQ',
EINPROGRESS: 'EINPROGRESS',
EINTR: 'EINTR',
EINVAL: 'EINVAL',
EIO: 'EIO',
EISCONN: 'EISCONN',
EISDIR: 'EISDIR',
EISNAM: 'EISNAM',
EKEYEXPIRED: 'EKEYEXPIRED',
EKEYREJECTED: 'EKEYREJECTED',
EKEYREVOKED: 'EKEYREVOKED',
EL2HLT: 'EL2HLT',
EL2NSYNC: 'EL2NSYNC',
EL3HLT: 'EL3HLT',
EL3RST: 'EL3RST',
ELIBACC: 'ELIBACC',
ELIBBAD: 'ELIBBAD',
ELIBMAX: 'ELIBMAX',
ELIBSCN: 'ELIBSCN',
ELIBEXEC: 'ELIBEXEC',
ELNRANGE: 'ELNRANGE',
ELOOP: 'ELOOP',
EMEDIUMTYPE: 'EMEDIUMTYPE',
EMFILE: 'EMFILE',
EMLINK: 'EMLINK',
EMSGSIZE: 'EMSGSIZE',
EMULTIHOP: 'EMULTIHOP',
ENAMETOOLONG: 'ENAMETOOLONG',
ENETDOWN: 'ENETDOWN',
ENETRESET: 'ENETRESET',
ENETUNREACH: 'ENETUNREACH',
ENFILE: 'ENFILE',
ENOANO: 'ENOANO',
ENOBUFS: 'ENOBUFS',
ENODATA: 'ENODATA',
ENODEV: 'ENODEV',
ENOENT: 'ENOENT',
ENOEXEC: 'ENOEXEC',
ENOKEY: 'ENOKEY',
ENOLCK: 'ENOLCK',
ENOLINK: 'ENOLINK',
ENOMEDIUM: 'ENOMEDIUM',
ENOMEM: 'ENOMEM',
ENOMSG: 'ENOMSG',
ENONET: 'ENONET',
ENOPKG: 'ENOPKG',
ENOPROTOOPT: 'ENOPROTOOPT',
ENOSPC: 'ENOSPC',
ENOSR: 'ENOSR',
ENOSTR: 'ENOSTR',
ENOSYS: 'ENOSYS',
ENOTBLK: 'ENOTBLK',
ENOTCONN: 'ENOTCONN',
ENOTDIR: 'ENOTDIR',
ENOTEMPTY: 'ENOTEMPTY',
ENOTRECOVERABLE: 'ENOTRECOVERABLE',
ENOTSOCK: 'ENOTSOCK',
ENOTSUP: 'ENOTSUP',
ENOTTY: 'ENOTTY',
ENOTUNIQ: 'ENOTUNIQ',
ENXIO: 'ENXIO',
EOPNOTSUPP: 'EOPNOTSUPP',
EOVERFLOW: 'EOVERFLOW',
EOWNERDEAD: 'EOWNERDEAD',
EPERM: 'EPERM',
EPFNOSUPPORT: 'EPFNOSUPPORT',
EPIPE: 'EPIPE',
EPROTO: 'EPROTO',
EPROTONOSUPPORT: 'EPROTONOSUPPORT',
EPROTOTYPE: 'EPROTOTYPE',
ERANGE: 'ERANGE',
EREMCHG: 'EREMCHG',
EREMOTE: 'EREMOTE',
EREMOTEIO: 'EREMOTEIO',
ERESTART: 'ERESTART',
ERFKILL: 'ERFKILL',
EROFS: 'EROFS',
ESHUTDOWN: 'ESHUTDOWN',
ESPIPE: 'ESPIPE',
ESOCKTNOSUPPORT: 'ESOCKTNOSUPPORT',
ESRCH: 'ESRCH',
ESTALE: 'ESTALE',
ESTRPIPE: 'ESTRPIPE',
ETIME: 'ETIME',
ETIMEDOUT: 'ETIMEDOUT',
ETOOMANYREFS: 'ETOOMANYREFS',
ETXTBSY: 'ETXTBSY',
EUCLEAN: 'EUCLEAN',
EUNATCH: 'EUNATCH',
EUSERS: 'EUSERS',
EWOULDBLOCK: 'EWOULDBLOCK',
EXDEV: 'EXDEV',
EXFULL: 'EXFULL',
};
const descriptions = {
[]: 'Argument list too long',
[]: 'Permission denied',
[]: 'Address already in use',
[]: 'Address not available',
[]: 'Address family not supported',
[]: 'Resource temporarily unavailable',
[]: 'Connection already in progress',
[]: 'Invalid exchange',
[]: 'Bad file descriptor',
[]: 'File descriptor in bad state',
[]: 'Bad message',
[]: 'Invalid request descriptor',
[]: 'Invalid request code',
[]: 'Invalid slot',
[]: 'Device or resource busy',
[]: 'Operation canceled',
[]: 'No child processes',
[]: 'Channel number out of range',
[]: 'Communication error on send',
[]: 'Connection aborted',
[]: 'Connection refused',
[]: 'Connection reset',
[]: 'Resource deadlock avoided',
[]: 'Resource deadlock avoided or File locking deadlock error',
[]: 'Destination address required',
[]: 'Mathematics argument out of domain of function',
[]: 'Disk quota exceeded',
[]: 'File exists',
[]: 'Bad address',
[]: 'File too large',
[]: 'Host is down',
[]: 'Host is unreachable',
[]: 'Memory page has hardware error',
[]: 'Identifier removed',
[]: 'Invalid or incomplete multibyte or wide character',
[]: 'Operation in progress',
[]: 'Interrupted function call',
[]: 'Invalid argument',
[]: 'Input/output error',
[]: 'Socket is connected',
[]: 'Is a directory',
[]: 'Is a named type file',
[]: 'Key has expired',
[]: 'Key was rejected by service',
[]: 'Key has been revoked',
[]: 'Level 2 halted',
[]: 'Level 2 not synchronized',
[]: 'Level 3 halted',
[]: 'Level 3 reset',
[]: 'Cannot access a needed shared library',
[]: 'Accessing a corrupted shared library',
[]: 'Attempting to link in too many shared libraries',
[]: '.lib section in a.out corrupted',
[]: 'Cannot exec a shared library directly',
[]: 'Link number out of range',
[]: 'Too many levels of symbolic links',
[]: 'Wrong medium type',
[]: 'Too many open files',
[]: 'Too many links',
[]: 'Message too long',
[]: 'Multihop attempted',
[]: 'Filename too long',
[]: 'Network is down',
[]: 'Connection aborted by network',
[]: 'Network unreachable',
[]: 'Too many open files in system',
[]: 'No anode',
[]: 'No buffer space available',
[]: 'No message is available on the STREAM head read queue',
[]: 'No such device',
[]: 'No such file or directory',
[]: 'Exec format error',
[]: 'Required key not available',
[]: 'No locks available',
[]: 'Link has been severed',
[]: 'No medium found',
[]: 'Not enough space/cannot allocate memory',
[]: 'No message of the desired type',
[]: 'Machine is not on the network',
[]: 'Package not installed',
[]: 'Protocol not available',
[]: 'No space left on device',
[]: 'No STREAM resources',
[]: 'Not a STREAM',
[]: 'Function not implemented',
[]: 'Block device required',
[]: 'The socket is not connected',
[]: 'Not a directory',
[]: 'Directory not empty',
[]: 'State not recoverable',
[]: 'Not a socket',
[]: 'Operation not supported',
[]: 'Inappropriate I/O control operation',
[]: 'Name not unique on network',
[]: 'No such device or address',
[]: 'Operation not supported on socket',
[]: 'Value too large to be stored in data type',
[]: 'Owner died',
[]: 'Operation not permitted',
[]: 'Protocol family not supported',
[]: 'Broken pipe',
[]: 'Protocol error',
[]: 'Protocol not supported',
[]: 'Protocol wrong type for socket',
[]: 'Result too large',
[]: 'Remote address changed',
[]: 'Object is remote',
[]: 'Remote I/O error',
[]: 'Interrupted system call should be restarted',
[]: 'Operation not possible due to RF-kill',
[]: 'Read-only filesystem',
[]: 'Cannot send after transport endpoint shutdown',
[]: 'Invalid seek',
[]: 'Socket type not supported',
[]: 'No such process',
[]: 'Stale file handle',
[]: 'Streams pipe error',
[]: 'Timer expired',
[]: 'Connection timed out',
[]: 'Too many references: cannot splice',
[]: 'Text file busy',
[]: 'Structure needs cleaning',
[]: 'Protocol driver not attached',
[]: 'Too many users',
[]: 'Operation would block',
[]: 'Improper link',
[]: 'Exchange full',
};
type Codes = typeof CODES;
export type ErrNoCode = Extract<Codes[keyof Codes], string>;
export function getDescription(code: ErrNoCode): string {
return descriptions[code];
}