This source file includes following definitions.
- strerror
#ifndef lint
static char rcsid[] = "$Header: /sprite/src/lib/c/string/RCS/strerror.c,v 1.5 89/03/22 16:06:57 rab Exp $ SPRITE (Berkeley)";
#endif
#include <stdio.h>
#include <string.h>
#ifdef BSD
char *sys_errlist[] = {
"no error (operation succeeded",
"not owner",
"no such file or directory",
"no such process",
"interrupted system call",
"I/O error",
"no such device or address",
"argument list too long",
"exec format error",
"bad file number",
"no children",
"no more processes",
"not enough memory",
"permission denied",
"bad address in system call argument",
"block device required",
"mount device busy",
"file already exists",
"cross-domain link",
"no such device",
"not a directory",
"illegal operation on a directory",
"invalid argument",
"file table overflow",
"too many open files",
"inappropriate device for ioctl",
"text file or pseudo-device busy",
"file too large",
"no space left in file system domain",
"illegal seek",
"read-only file system",
"too many links",
"broken pipe",
"math argument out of range",
"math result unrepresentable",
"operation would block",
"operation now in progress",
"operation already in progress",
"socket operation on non-socket",
"destination address required",
"message too long",
"protocol wrong type for socket",
"bad proocol option",
"protocol not suppored",
"socket type not supported",
"operation not supported on socket",
"protocol family not supported",
"address family not supported by protocol family",
"address already in use",
"can't assign requested address",
"network is down",
"network is unreachable",
"network dropped connection on reset",
"software caused connection abort",
"connection reset by peer",
"no buffer space available",
"socket is already connected",
"socket is not connected",
"can't send afer socket shutdown",
"undefined error (59)",
"connection timed out",
"connection refused",
"too many levels of symbolic links",
"file name too long",
"host is down",
"host is unreachable",
"directory not empty",
"too many processes",
"too many users",
"disk quota exceeded",
"stale remote file handle",
"pathname hit remote file system",
};
int sys_nerr = sizeof(sys_errlist)/sizeof(char *);
#else
extern char *sys_errlist[];
extern int sys_nerr;
#endif
char *
strerror(error)
int error;
{
static char defaultMsg[50];
if ((error <= sys_nerr) && (error > 0)) {
return sys_errlist[error];
}
(void) sprintf(defaultMsg, "unknown error (%d)", error);
return defaultMsg;
}