summaryrefslogtreecommitdiff
path: root/usr.sbin/config/strerror.c
blob: 72cf0d6fbeffd03db8d08ab3ea35e2edb7660df7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
 * 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(en)
    int en;
{
    if ((0 <= en) && (en < sys_nerr))
	return sys_errlist[en];

    snprintf(errmsg, sizeof errmsg, "Error %d", en);
    return errmsg;
}