summaryrefslogtreecommitdiff
path: root/Build/source/utils/t1utils/strerror.c
blob: b47f24ed2f8e336dde10a7cee871638a5f8df3e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* Some operating systems don't have strerror.
   This file provides a definition which David Mazieres <dm@lcs.mit.edu>
   assures me works. */

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif

char *
strerror(int errno)
{
  extern int sys_nerr;
  extern char *sys_errlist[];
  if (errno < 0 || errno >= sys_nerr)
    return (char *)"bad error number";
  else
    return sys_errlist[errno];
}

#ifdef __cplusplus
}
#endif