git: 9front

ref: 3660a052132934c96d12a8e69f3e8728ef8c460d
dir: /sys/src/ape/lib/ap/stdio/perror.c/

View raw version
/*
 * pANS stdio -- perror
 */
#include "iolib.h"
#include <errno.h>

void perror(const char *s){
	if(s!=NULL && *s != '\0') fputs(s, stderr), fputs(": ", stderr);
	fputs(strerror(errno), stderr);
	putc('\n', stderr);
	fflush(stderr);
}