NetBSD/usr.bin/config/strerror.c
thorpej 5ecc953bdb config and genassym are not sysadmin tools, they are development tools.
As such, they don't belong in /usr/sbin, but rather /usr/bin.  Move them
there.
2005-06-05 18:19:52 +00:00

23 lines
420 B
C

/* $NetBSD: strerror.c,v 1.1 2005/06/05 18:19:53 thorpej Exp $ */
/*
* 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)
{
if ((0 <= en) && (en < sys_nerr))
return sys_errlist[en];
snprintf(errmsg, sizeof(errmsg), "Error %d", en);
return errmsg;
}