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