summaryrefslogtreecommitdiff
path: root/include/string.h
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2002-07-07 20:13:41 +0000
committerManuel Novoa III <mjn3@codepoet.org>2002-07-07 20:13:41 +0000
commitb815b84a5942f591e8a79c731100712558fa41c6 (patch)
treeff518c2c84178cdbf35699ca463577bf6e9dee19 /include/string.h
parentc1383d79d31e9607a938215462f025bad3f14060 (diff)
Attempt to clean up the strerror_r situation.
Diffstat (limited to 'include/string.h')
-rw-r--r--include/string.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/include/string.h b/include/string.h
index d7501eb83..edcdf19fe 100644
--- a/include/string.h
+++ b/include/string.h
@@ -232,10 +232,29 @@ extern size_t strnlen (__const char *__string, size_t __maxlen)
/* Return a string describing the meaning of the `errno' code in ERRNUM. */
extern char *strerror (int __errnum) __THROW;
-#ifdef __USE_MISC
-/* Reentrant version of `strerror'. If a temporary buffer is required, at
- most BUFLEN bytes of BUF will be used. */
-extern int strerror_r (int __errnum, char *__buf, size_t buflen) __THROW;
+
+/* Reentrant versions of `strerror'. If a temporary buffer is required,
+ at most BUFLEN bytes of BUF will be used. These symbols are _NOT_ intended
+ to be applications, and can change at any time. */
+extern char *_glibc_strerror_r (int __errnum, char *__buf, size_t __buflen) __THROW;
+extern int _susv3_strerror_r (int __errnum, char *__buf, size_t buflen) __THROW;
+
+#if defined(__USE_XOPEN2K) && !defined(__USE_GNU)
+# ifdef __REDIRECT
+extern int __REDIRECT (strerror_r,
+ (int __errnum, char *__buf, size_t buflen) __THROW,
+ _susv3_strerror_r);
+# else
+# define strerror_r _susv3_strerror_r
+# endif
+#elif defined(__USE_MISC)
+# ifdef __REDIRECT
+extern char *__REDIRECT (strerror_r,
+ (int __errnum, char *__buf, size_t buflen) __THROW,
+ _glibc_strerror_r);
+# else
+# define strerror_r _glibc_strerror_r
+# endif
#endif
/* We define this function always since `bzero' is sometimes needed when