diff options
Diffstat (limited to 'src/gpg-error.h')
-rw-r--r-- | src/gpg-error.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gpg-error.h b/src/gpg-error.h index cf6d2f5..5f92564 100644 --- a/src/gpg-error.h +++ b/src/gpg-error.h @@ -21,6 +21,8 @@ #ifndef GPG_ERROR_H #define GPG_ERROR_H 1 +#include <stddef.h> + #ifdef __GNUC__ #define GPG_ERR_INLINE __inline__ #elif __STDC_VERSION__ >= 199901L @@ -496,11 +498,14 @@ gpg_err_source (gpg_error_t err) code in the error value ERR. This function is not thread-safe. */ const char *gpg_strerror (gpg_error_t err); -/* Return a pointer to a string containing a description of the error - code in the error value ERR. The buffer for the string is - allocated with malloc(), and has to be released by the user. On - error, NULL is returned. */ -char *gpg_strerror_r (gpg_error_t err); +/* Return the error string for ERR in the user-supplied buffer BUF of + size BUFLEN. This function is, in contrast to gpg_strerror, + thread-safe if a thread-safe strerror_r() function is provided by + the system. If the function succeeds, 0 is returned and BUF + contains the string describing the error. If the buffer was not + large enough, ERANGE is returned and BUF contains as much of the + beginning of the error string as fits into the buffer. */ +int gpg_strerror_r (gpg_error_t err, char *buf, size_t buflen); /* Return a pointer to a string containing a description of the error source in the error value ERR. */ |