1 --- strerror.c.orig 2004-11-25 11:38:47.000000000 -0800
2 +++ strerror.c 2005-04-30 01:26:56.000000000 -0700
5 #define EBUFSIZE (20 + sizeof(UPREFIX))
7 +#ifndef BUILDING_VARIANT
9 * Doing this by hand instead of linking with stdio(3) avoids bloat for
10 * statically linked binaries.
13 -errstr(int num, char *buf, size_t len)
14 +__private_extern__ void
15 +__errstr(int num, char *buf, size_t len)
20 strerror_r(int errnum, char *strerrbuf, size_t buflen)
23 - if (errnum < 1 || errnum >= sys_nerr) {
24 - errstr(errnum, strerrbuf, buflen);
25 + if (errnum < 0 || errnum >= sys_nerr) {
26 + __errstr(errnum, strerrbuf, buflen);
29 if (strlcpy(strerrbuf, sys_errlist[errnum], buflen) >= buflen)
33 +#else /* BUILDING_VARIANT */
34 +__private_extern__ void __errstr(int, char *, size_t);
35 +#endif /* !BUILDING_VARIANT */
41 if (num > 0 && num < sys_nerr)
42 return ((char *)sys_errlist[num]);
45 - errstr(num, ebuf, sizeof(ebuf));
46 +#endif /* !__DARWIN_UNIX03 */
47 + __errstr(num, ebuf, sizeof(ebuf));