aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg-error.h.in
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/gpg-error.h.in16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gpg-error.h.in b/src/gpg-error.h.in
index 7c372ce..46325c5 100644
--- a/src/gpg-error.h.in
+++ b/src/gpg-error.h.in
@@ -212,7 +212,7 @@ const char *gpg_strsource (gpg_error_t err);
/* Retrieve the error code for the system error ERR. This returns
GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
- this). */
+ this). */
gpg_err_code_t gpg_err_code_from_errno (int err);
@@ -220,6 +220,14 @@ gpg_err_code_t gpg_err_code_from_errno (int err);
if CODE is not a system error code. */
int gpg_err_code_to_errno (gpg_err_code_t code);
+
+/* Retrieve the error code directly from the ERRNO variable. This
+ returns GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped
+ (report this) and GPG_ERR_MISSING_ERRNO if ERRNO has the value 0. */
+gpg_err_code_t gpg_err_code_from_syserror (void);
+
+
+
/* Self-documenting convenience functions. */
@@ -236,6 +244,12 @@ gpg_error_from_errno (int err)
return gpg_error (gpg_err_code_from_errno (err));
}
+static GPG_ERR_INLINE gpg_error_t
+gpg_error_from_syserror (void)
+{
+ return gpg_error (gpg_err_code_from_syserror ());
+}
+
#ifdef __cplusplus
}
#endif