home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume28 / bootp-2.4.0 / part01 / strerror.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-22  |  389 b   |  22 lines

  1. /*
  2.  * strerror() - for those systems that don't have it yet.
  3.  * Doing it this way avoids yet another ifdef...
  4.  */
  5.  
  6. /* These are part of the C library. (See perror.3) */
  7. extern char *sys_errlist[];
  8. extern int sys_nerr;
  9.  
  10. static char errmsg[80];
  11.  
  12. char *
  13. strerror(en)
  14.     int en;
  15. {
  16.     if ((0 <= en) && (en < sys_nerr))
  17.         return sys_errlist[en];
  18.  
  19.     sprintf(errmsg, "Error %d", en);
  20.     return errmsg;
  21. }
  22.