1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:14:58 +00:00

Kernel+LibC: Move errno definitions to Kernel/API/POSIX

This fixes at least half of our LibC includes in the kernel. The source
of truth for errno codes and their description strings now lives in
Kernel/API/POSIX/errno.h as an enumeration, which LibC includes.
This commit is contained in:
sin-ack 2021-09-12 11:29:28 +00:00 committed by Ali Mohammad Pur
parent 0cca6cef95
commit 69ef211925
23 changed files with 123 additions and 183 deletions

View file

@ -264,87 +264,9 @@ char* strncat(char* dest, const char* src, size_t n)
}
const char* const sys_errlist[] = {
"Success (not an error)",
"Operation not permitted",
"No such file or directory",
"No such process",
"Interrupted syscall",
"I/O error",
"No such device or address",
"Argument list too long",
"Exec format error",
"Bad fd number",
"No child processes",
"Try again",
"Out of memory",
"Permission denied",
"Bad address",
"Block device required",
"Device or resource busy",
"File already exists",
"Cross-device link",
"No such device",
"Not a directory",
"Is a directory",
"Invalid argument",
"File table overflow",
"Too many open files",
"Not a TTY",
"Text file busy",
"File too large",
"No space left on device",
"Illegal seek",
"Read-only filesystem",
"Too many links",
"Broken pipe",
"Range error",
"Name too long",
"Too many symlinks",
"Overflow",
"Operation not supported",
"No such syscall",
"Not implemented",
"Address family not supported",
"Not a socket",
"Address in use",
"Failed without setting an error code (bug!)",
"Directory not empty",
"Math argument out of domain",
"Connection refused",
"Host is down",
"Address not available",
"Already connected",
"Connection aborted",
"Connection already in progress",
"Connection reset",
"Destination address required",
"Host unreachable",
"Illegal byte sequence",
"Message size",
"Network down",
"Network unreachable",
"Network reset",
"No buffer space",
"No lock available",
"No message",
"No protocol option",
"Not connected",
"Transport endpoint has shutdown",
"Too many references",
"Protocol not supported",
"Socket type not supported",
"Resource deadlock would occur",
"Timed out",
"Wrong protocol type",
"Operation in progress",
"No such thread",
"Protocol error",
"Not supported",
"Protocol family not supported",
"Cannot make directory a subdirectory of itself",
"Quota exceeded",
"State not recoverable",
"The highest errno +1 :^)",
#define __ENUMERATE_ERRNO_CODE(c, s) s,
ENUMERATE_ERRNO_CODES(__ENUMERATE_ERRNO_CODE)
#undef __ENUMERATE_ERRNO_CODE
};
static_assert(array_size(sys_errlist) == (EMAXERRNO + 1));