xref: /plan9/sys/src/libc/port/perror.c (revision 9a747e4fd48b9f4522c70c07e8f882a15030f964)
1 #include <u.h>
2 #include <libc.h>
3 
4 void
perror(char * s)5 perror(char *s)
6 {
7 	char buf[ERRMAX];
8 
9 	buf[0] = '\0';
10 	errstr(buf, sizeof buf);
11 	if(s && *s)
12 		fprint(2, "%s: %s\n", s, buf);
13 	else
14 		fprint(2, "%s\n", buf);
15 }
16