7 char *strerror(int errnum)
9 static char message[32] = "error "; /* enough for error 2^63-1 */
12 unsigned int e = (unsigned int)errnum;
15 extern const int sys_nerr;
16 extern const char * const sys_errlist[];
18 if ( e < (unsigned int)sys_nerr && sys_errlist[e] )
19 return (char *)sys_errlist[e];
22 p = numbuf+sizeof numbuf;
26 *--p = (e % 10) + '0';
30 memcpy(message+6, p, (numbuf+sizeof numbuf)-p);