1 #include <u.h> 2 #include <libc.h> 3 4 void 5 perror(char *s) 6 { 7 char buf[ERRLEN]; 8 9 buf[0] = 0; 10 errstr(buf); 11 if(s && *s) 12 fprint(2, "%s: %s\n", s, buf); 13 else 14 fprint(2, "%s\n", buf); 15 } 16