1: # include   <sccs.h>
   2: 
   3: SCCSID(@(#)perror.c	8.1	12/31/84)
   4: 
   5: /*
   6:  * Print the error indicated
   7:  * in the cerror cell.
   8:  * ----
   9:  * this code stolen from the system perror, the only change is that we print
  10:  * on 1, instead of 2 (which is usally closed).
  11:  */
  12: 
  13: int errno;
  14: int sys_nerr;
  15: char    *sys_errlist[];
  16: perror(s)
  17: char *s;
  18: {
  19:     register char *c;
  20:     register n;
  21: 
  22:     c = "Unknown error";
  23:     if(errno < sys_nerr)
  24:         c = sys_errlist[errno];
  25:     n = strlen(s);
  26:     if(n) {
  27:         write(1, s, n);
  28:         write(1, ": ", 2);
  29:     }
  30:     write(1, c, strlen(c));
  31:     write(1, "\n", 1);
  32: }

Defined functions

perror defined in line 16; used 1 times

Defined variables

errno defined in line 13; used 2 times
sys_errlist defined in line 15; used 1 times
  • in line 24
sys_nerr defined in line 14; used 1 times
  • in line 23
Last modified: 1986-04-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 842
Valid CSS Valid XHTML 1.0 Strict