NetBSD/usr.sbin/config/strerror.c

23 lines
419 B
C
Raw Normal View History

2003-07-13 16:29:20 +04:00
/* $NetBSD: strerror.c,v 1.4 2003/07/13 12:36:49 itojun Exp $ */
1998-01-09 11:03:16 +03:00
/*
* strerror() - for those systems that don't have it yet.
*/
/* These are part of the C library. (See perror.3) */
extern char *sys_errlist[];
extern int sys_nerr;
static char errmsg[80];
char *
strerror(int en)
{
2003-07-13 16:29:20 +04:00
if ((0 <= en) && (en < sys_nerr))
return sys_errlist[en];
2003-07-13 16:29:20 +04:00
snprintf(errmsg, sizeof(errmsg), "Error %d", en);
return errmsg;
}