/* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. * * %sccs.include.redist.c% */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strerror.c 5.3 (Berkeley) 06/01/90"; #endif /* LIBC_SCCS and not lint */ #include char * strerror(errnum) int errnum; { extern int sys_nerr; extern char *sys_errlist[]; static char ebuf[20]; if ((unsigned int)errnum < sys_nerr) return(sys_errlist[errnum]); (void)sprintf(ebuf, "Unknown error: %d", errnum); return(ebuf); }