shithub: riscv

ref: 27bdfccc4095a289e1a9bfcc1e98f5cca9c0a9c3
dir: /sys/src/libc/port/perror.c/

View raw version
#include <u.h>
#include <libc.h>

void
perror(char *s)
{
	char buf[ERRMAX];

	buf[0] = '\0';
	errstr(buf, sizeof buf);
	if(s && *s)
		fprint(2, "%s: %s\n", s, buf);
	else
		fprint(2, "%s\n", buf);
}