1 /* strerror.c: A replacement for the strerror function
4 This software is Copyright 1996 by Craig Metz, All Rights Reserved.
5 The Inner Net License Version 2 applies to this software.
6 You should have received a copy of the license with this software. If
7 you didn't get a copy, you may request one from <license@inner.net>.
11 Created by cmetz for OPIE 2.2.
17 char *strerror FUNCTION((errnum), int errnum)
20 extern char *sys_errlist[];
21 return sys_errlist[errnum];
22 #else /* NEED_STRERROR */
24 extern char *_sys_errlist[];
25 return sys_errlist[errnum];
26 #else /* HAVE__SYS_ERRLIST */
27 static char hexdigits[] = "0123456789abcdef";
28 static char buffer[] = "System error 0x42";
29 buffer[15] = hexdigits[(errnum >> 4) & 0x0f];
30 buffer[16] = hexdigits[errnum & 0x0f];
32 #endif /* HAVE__SYS_ERRLIST */
33 #endif /* NEED_STRERROR */