1: /*	@(#)perror.c	2.1	SCCS id keyword	*/
   2: /*
   3:  * Print the error indicated
   4:  * in the cerror cell.
   5:  */
   6: 
   7: int errno;
   8: int sys_nerr;
   9: char    *sys_errlist[];
  10: perror(s)
  11: char *s;
  12: {
  13:     register char *c;
  14:     register n;
  15: 
  16:     c = "Unknown error";
  17:     if(errno < sys_nerr)
  18:         c = sys_errlist[errno];
  19:     n = strlen(s);
  20:     if(n) {
  21:         write(2, s, n);
  22:         write(2, ": ", 2);
  23:     }
  24:     write(2, c, strlen(c));
  25:     write(2, "\n", 1);
  26: }

Defined functions

perror defined in line 10; used 472 times

Defined variables

errno defined in line 7; used 224 times
sys_nerr defined in line 8; used 4 times
Last modified: 1981-07-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 846
Valid CSS Valid XHTML 1.0 Strict