1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #include "_stdio.h"
- #ifdef __UCLIBC_MJN3_ONLY__
- #warning CONSIDER: Increase buffer size for error message (non-%m case)?
- #endif
- void perror(register const char *s)
- {
-
- register const char *sep;
- sep = ": ";
- if (!(s && *s)) {
- s = (sep += 2);
- }
- #ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
- fprintf(stderr, "%s%s%m\n", s, sep);
- #else
- {
- char buf[64];
- fprintf(stderr, "%s%s%s\n", s, sep,
- __glibc_strerror_r(errno, buf, sizeof(buf)));
- }
- #endif
- }
- libc_hidden_def(perror)
|