shithub: scc

ref: 68fc5b73b8cc4ba666d8d30d74762c71a0653a9d
dir: /src/libc/stdio/perror.c/

View raw version
#include <errno.h>
#include <stdio.h>
#include <string.h>

#undef perror

void
perror(const char *msg)
{
	if (msg && *msg) {
		fputs(msg, stderr);
		putc(':', stderr);
		putc(' ', stderr);
	}
	fputs(strerror(errno), stderr);
	putc('\n', stderr);
}