home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 163_01 / perror.c < prev    next >
Text File  |  1988-01-31  |  640b  |  15 lines

  1. /*
  2. ** print string s, followed by a colon and the message corresponding to
  3. ** the current value of _errno
  4. */
  5. extern int *stderr, fputs(), fputc(), errno, sys_nerr, sys_errlist[];
  6. perror(s) char *s; {
  7.   fputs(s, stderr);
  8.   fputs(":  ", stderr);
  9.   if(errno < sys_nerr)
  10.     fputs(sys_errlist[errno], stderr);
  11.   else
  12.     fputs("Undefined error", stderr);
  13.   fputc('\n', stderr);
  14.   }
  15.