1106163Sroberto#include <config.h>
2106163Sroberto
3106163Sroberto#if !HAVE_STRERROR
454359Sroberto/*
554359Sroberto * Copyright (c) 1988 Regents of the University of California.
654359Sroberto * All rights reserved.
754359Sroberto *
854359Sroberto * Redistribution and use in source and binary forms are permitted
954359Sroberto * provided that the above copyright notice and this paragraph are
1054359Sroberto * duplicated in all such forms and that any documentation,
1154359Sroberto * advertising materials, and other materials related to such
1254359Sroberto * distribution and use acknowledge that the software was developed
1354359Sroberto * by the University of California, Berkeley.  The name of the
1454359Sroberto * University may not be used to endorse or promote products derived
1554359Sroberto * from this software without specific prior written permission.
1654359Sroberto * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
1754359Sroberto * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1854359Sroberto * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1954359Sroberto */
2054359Sroberto
2154359Sroberto#if defined(LIBC_SCCS) && !defined(lint)
2254359Srobertostatic const char sccsid[] = "@(#)strerror.c	5.1 (Berkeley) 4/9/89";
2354359Sroberto#endif /* LIBC_SCCS and not lint */
2454359Sroberto
2554359Sroberto#include <sys/types.h>
2654359Sroberto
2754359Sroberto#include <stdio.h>
2854359Sroberto#include <string.h>
2954359Sroberto
30132451Sroberto#include "l_stdlib.h"
31132451Sroberto
3254359Srobertochar *
3354359Srobertostrerror(
3454359Sroberto	int errnum
3554359Sroberto	)
3654359Sroberto{
3754359Sroberto	extern int sys_nerr;
3854359Sroberto	extern char *sys_errlist[];
3954359Sroberto	static char ebuf[20];
4054359Sroberto
4154359Sroberto	if ((unsigned int)errnum < sys_nerr)
4254359Sroberto		return(sys_errlist[errnum]);
4354359Sroberto	(void)sprintf(ebuf, "Unknown error: %d", errnum);
4454359Sroberto	return(ebuf);
4554359Sroberto}
46106163Sroberto#else
47106163Srobertoint strerror_bs;
48106163Sroberto#endif
49