1#include "libc.h" 2#include <errno.h> 3#include <string.h> 4 5#define E(a, b) ((unsigned char)a), 6static const unsigned char errid[] = { 7#include "__strerror.h" 8}; 9 10#undef E 11#define E(a, b) b "\0" 12static const char errmsg[] = 13#include "__strerror.h" 14 ; 15 16char* strerror(int e) { 17 const char* s; 18 int i; 19 for (i = 0; errid[i] && errid[i] != e; i++) 20 ; 21 for (s = errmsg; i; s++, i--) 22 for (; *s; s++) 23 ; 24 return (char*)s; 25} 26