shithub: plan9front

ref: 1eca33b48c25d3ee58691ea8f9d122cdf12a57a6
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);
}