1#include <errno.h>2#include <stdio.h>3#include <string.h>45#undef perror67void8perror(const char *msg)9{10 if (msg && *msg) {11 fputs(msg, stderr);12 putc(':', stderr);13 putc(' ', stderr);14 }15 fputs(strerror(errno), stderr);16 putc('\n', stderr);17}