xref: /csrg-svn/lib/libc/string/strerror.c (revision 42635)
137340Sbostic /*
237340Sbostic  * Copyright (c) 1988 Regents of the University of California.
337340Sbostic  * All rights reserved.
437340Sbostic  *
5*42635Sbostic  * %sccs.include.redist.c%
637340Sbostic  */
737340Sbostic 
837340Sbostic #if defined(LIBC_SCCS) && !defined(lint)
9*42635Sbostic static char sccsid[] = "@(#)strerror.c	5.3 (Berkeley) 06/01/90";
1037340Sbostic #endif /* LIBC_SCCS and not lint */
1137340Sbostic 
1242181Sbostic #include <string.h>
1342181Sbostic 
1437340Sbostic char *
1537340Sbostic strerror(errnum)
1637340Sbostic 	int errnum;
1737340Sbostic {
1837340Sbostic 	extern int sys_nerr;
1937340Sbostic 	extern char *sys_errlist[];
2037340Sbostic 	static char ebuf[20];
2137340Sbostic 
2237340Sbostic 	if ((unsigned int)errnum < sys_nerr)
2337340Sbostic 		return(sys_errlist[errnum]);
2437340Sbostic 	(void)sprintf(ebuf, "Unknown error: %d", errnum);
2537340Sbostic 	return(ebuf);
2637340Sbostic }
27