missing/strerror.c


DEFINITIONS

This source file includes following functions.
  1. strerror


   1  /* public domain rewrite of strerror(3) */
   2  
   3  extern int sys_nerr;
   4  extern char *sys_errlist[];
   5  
   6  static char msg[50];
   7  
   8  char *
   9  strerror(error)
  10      int error;
  11  {
  12      if (error <= sys_nerr && error > 0) {
  13          return sys_errlist[error];
  14      }
  15      sprintf(msg, "Unknown error (%d)", error);
  16      return msg;
  17  }