home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / bootpd-2.zip / STRERROR.C < prev    next >
C/C++ Source or Header  |  1994-03-07  |  389b  |  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.