diff --git a/src/string/strerror.c b/src/string/strerror.c index 25a85d5..c2edae4 100644 --- a/src/string/strerror.c +++ b/src/string/strerror.c @@ -1,7 +1,43 @@ #include +#include // "Lower" group of errors -static const char *error0[64] = {}; +static const char *error0[64] = { + [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" +}; char *strerror(int errnum) { if (!errnum) {