pkgsrc/pkgtools/libnbcompat/files/strerror.c
grant 706e3fa728 Initial import of libnbcompat-20030331, a portable NetBSD compatibility
library for use by the pkgsrc tools and other sources from NetBSD.
2003-03-31 05:02:17 +00:00

19 lines
354 B
C

/* $NetBSD: strerror.c,v 1.1.1.1 2003/03/31 05:02:57 grant Exp $ */
#include "nbcompat.h"
char *
strerror(int n)
{
static char msg[] = "Unknown error (1234567890)";
extern int sys_nerr;
extern char *sys_errlist[];
if (n >= sys_nerr) {
snprintf(msg, sizeof(msg), "Unknown error (%d)", n);
return(msg);
} else {
return(sys_errlist[n]);
}
}