File: strerror.c

package info (click to toggle)
bootp 2.4.3-18
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, squeeze, stretch, wheezy
  • size: 484 kB
  • ctags: 611
  • sloc: ansic: 5,926; makefile: 153; sh: 55
file content (21 lines) | stat: -rw-r--r-- 389 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * strerror() - for those systems that don't have it yet.
 * Doing it this way avoids yet another ifdef...
 */

/* 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];

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