]> git.ozlabs.org Git - ppp.git/blob - pppd/plugins/radius/radiusclient/lib/strerror.c
Add these files, used with TDB.
[ppp.git] / pppd / plugins / radius / radiusclient / lib / strerror.c
1 /*
2  * $Id: strerror.c,v 1.2 2002/02/27 15:51:20 dfs Exp $
3  *
4  * Copyright (C) 1996 Lars Fenneberg and Christian Graefe
5  *
6  * This file is provided under the terms and conditions of the GNU general
7  * public license, version 2 or any later version, incorporated herein by
8  * reference.
9  *
10  */
11
12 #include "config.h"
13 #include "includes.h"
14
15 /*
16  * if we're missing strerror, these are mostly not defined either
17  */
18 extern int sys_nerr;
19 extern char *sys_errlist[];
20
21 /*
22  * Function: strerror
23  *
24  * Purpose:  implements strerror for systems which lack it. if these
25  *                       systems even lack sys_errlist, you loose...
26  *
27  */
28
29
30 char *strerror(int err)
31 {
32         static char buf[32];
33
34         if (err >= 0 && err < sys_nerr)
35                 return sys_errlist[err];
36         else {
37                 sprintf(buf, "unknown error: %d", errno);
38                 return buf;
39         }
40 }