mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 05:57:52 +00:00
Explain <isc/strerr.h> a little more
The purpose of the `strerror_r()` wrapper was not obvious.
This commit is contained in:
parent
fe8e7e5958
commit
b0893ae09a
3
CHANGES
3
CHANGES
@ -1,3 +1,6 @@
|
||||
6101. [port] Clarify the portability dodge needed for `strerror_r()`
|
||||
[GL !7465]
|
||||
|
||||
6100. [cleanup] Deprecate <isc/deprecated.h>, because obsolete
|
||||
functions are now deleted instead of marked with
|
||||
an attribute. [GL !7466]
|
||||
|
@ -26,4 +26,8 @@
|
||||
#if defined(strerror_r)
|
||||
#undef strerror_r
|
||||
#endif /* if defined(strerror_r) */
|
||||
|
||||
/*
|
||||
* Ensure we use a consistent implementation of strerror_r()
|
||||
*/
|
||||
#define strerror_r isc_string_strerror_r
|
||||
|
@ -55,6 +55,14 @@
|
||||
|
||||
#include <isc/string.h> /* IWYU pragma: keep */
|
||||
|
||||
/*
|
||||
* We undef _GNU_SOURCE above to get the POSIX strerror_r()
|
||||
*/
|
||||
int
|
||||
isc_string_strerror_r(int errnum, char *buf, size_t buflen) {
|
||||
return (strerror_r(errnum, buf, buflen));
|
||||
}
|
||||
|
||||
#if !defined(HAVE_STRLCPY)
|
||||
size_t
|
||||
strlcpy(char *dst, const char *src, size_t size) {
|
||||
@ -136,8 +144,3 @@ strnstr(const char *s, const char *find, size_t slen) {
|
||||
return ((char *)s);
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
isc_string_strerror_r(int errnum, char *buf, size_t buflen) {
|
||||
return (strerror_r(errnum, buf, buflen));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user