diff options
author | Greg Hudson <ghudson@mit.edu> | 2014-07-05 10:14:34 -0400 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2014-07-08 19:19:24 -0400 |
commit | 6351586a771e9a99e1e946cc9a0b6a87bbb14094 (patch) | |
tree | dff3726e4c2a71c7edd1fc57df8f6bee74d895ee /src/include | |
parent | 48a0b16ab1f70b6486a6d7af7ca9e7b376b19956 (diff) | |
download | krb5-6351586a771e9a99e1e946cc9a0b6a87bbb14094.zip krb5-6351586a771e9a99e1e946cc9a0b6a87bbb14094.tar.gz krb5-6351586a771e9a99e1e946cc9a0b6a87bbb14094.tar.bz2 |
Define k5-platform.h wrapper for strerror_r
On systems where strerror_r is not the POSIX version, define it to
k5_strerror_r. Implement k5_strerror_r in libkrb5support using
strerror_s, strerror, or the GNU strerror_r as appropriate.
ticket: 7961
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/k5-platform.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/include/k5-platform.h b/src/include/k5-platform.h index e5fd004..cff7dc3 100644 --- a/src/include/k5-platform.h +++ b/src/include/k5-platform.h @@ -38,6 +38,7 @@ * + strlcpy/strlcat * + fnmatch * + [v]asprintf + * + strerror_r * + mkstemp * + zap (support function; macro is in k5-int.h) * + constant time memory comparison @@ -998,6 +999,11 @@ extern int asprintf(char **, const char *, ...) #define SNPRINTF_OVERFLOW(result, size) \ ((unsigned int)(result) >= (size_t)(size)) +#if defined(_WIN32) || !defined(HAVE_STRERROR_R) || defined(STRERROR_R_CHAR_P) +#define strerror_r k5_strerror_r +#endif +extern int k5_strerror_r(int errnum, char *buf, size_t buflen); + #ifndef HAVE_MKSTEMP extern int krb5int_mkstemp(char *); #define mkstemp krb5int_mkstemp |