2000-10-02 23:48:34 +04:00
|
|
|
/* $NetBSD: strerror.c,v 1.3 2000/10/02 19:48:35 cgd Exp $ */
|
1998-01-09 11:03:16 +03:00
|
|
|
|
1996-11-08 01:59:39 +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];
|
|
|
|
|
2000-10-02 23:48:34 +04:00
|
|
|
char *
|
|
|
|
strerror(int en)
|
1996-11-08 01:59:39 +03:00
|
|
|
{
|
2000-10-02 23:48:34 +04:00
|
|
|
|
1996-11-08 01:59:39 +03:00
|
|
|
if ((0 <= en) && (en < sys_nerr))
|
|
|
|
return sys_errlist[en];
|
|
|
|
|
|
|
|
sprintf(errmsg, "Error %d", en);
|
|
|
|
return errmsg;
|
|
|
|
}
|