123456789101112131415161718192021222324252627 |
- #include <string.h>
- #include <stdio.h>
- #include <errno.h>
- void perror(__const char *str)
- {
- static const char perror_str[] = ": ";
- const char *sep;
- sep = perror_str;
- if (!(str && *str)) {
- sep += 2;
- str = sep;
- }
- fprintf(stderr, "%s%s%s\n", str, sep, strerror(errno));
- }
|