Provide implementation for perror(3)
This commit is contained in:
parent
80beba98c7
commit
eaff9ccf1d
|
@ -123,6 +123,7 @@ void clearerr(FILE *stream);
|
||||||
int feof(FILE *stream);
|
int feof(FILE *stream);
|
||||||
int ferror(FILE *stream);
|
int ferror(FILE *stream);
|
||||||
int fileno(FILE *stream);
|
int fileno(FILE *stream);
|
||||||
|
void perror(const char *s);
|
||||||
|
|
||||||
#define getc(f) fgetc(f)
|
#define getc(f) fgetc(f)
|
||||||
|
|
||||||
|
|
|
@ -114,3 +114,8 @@ int strerror_r(int errnum, char *strerrbuf, size_t buflen)
|
||||||
snprintf(strerrbuf, buflen, "Unknown error %d", errnum);
|
snprintf(strerrbuf, buflen, "Unknown error %d", errnum);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void perror(const char *s)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s: %s\n", s, strerror(errno));
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue