#include #include static char *errno_strings [] = { [0] = "Success", [EDOM] = "Numerical argument out of domain", [EILSEQ] = "Invalid or incomplete multibyte or wide character", [ERANGE] = "Numerical result out of range", }; char *strerror(int e) { int count = sizeof errno_strings / sizeof errno_strings[0]; return (e >= 0 && e < count) ? errno_strings[e] : ""; }