From 5b0c2c6d870cc9f9f2eae32f4d71abc6f9348e20 Mon Sep 17 00:00:00 2001 From: Manuel Novoa III Date: Tue, 18 Jun 2002 08:41:28 +0000 Subject: Fix perror() and printf("%m") to not call strerror(), as required by the standards. Temporarily added a utility function to wrap Erik's strerror_r so that "Unknown error xxx" strings can be generated for errno's which cause strerror_r to fail. That utility function will eventually be merged in with the strerror/strerror_r functions when I change over to optionallly mmap'ing the system error strings to provide for lower mem comsumption on non-MMU platforms, as well as locale-specific system error messages. --- libc/sysdeps/linux/common/bits/uClibc_stdio.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libc/sysdeps/linux/common/bits/uClibc_stdio.h') diff --git a/libc/sysdeps/linux/common/bits/uClibc_stdio.h b/libc/sysdeps/linux/common/bits/uClibc_stdio.h index 83ca2fb04..1a559bd9c 100644 --- a/libc/sysdeps/linux/common/bits/uClibc_stdio.h +++ b/libc/sysdeps/linux/common/bits/uClibc_stdio.h @@ -438,6 +438,14 @@ typedef enum { __UIM_UPPER = 'A' - 10, } __UIM_CASE; +/* WARNING!!! While similar to the glibc strerror_r function, the + * following function is not the same. It expects "unknown" error + * strings will fit in the buffer passed. Also, the return value + * may not be == buf, as unknown strings are "right-justified" in + * the buf due to the way _int10stostr works. */ + +extern char *_stdio_strerror_r(int err, char *buf, size_t buflen); + /* Write a NULL-terminated list of "char *" args to file descriptor fd. * For an example of usage, see __assert.c. */ -- cgit v1.2.3