[git] GPG-ERROR - branch, master, updated. libgpg-error-1.24-13-gb797276
by Werner Koch
cvs at cvs.gnupg.org
Sat Nov 12 11:09:29 CET 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Error codes used by GnuPG et al.".
The branch, master has been updated
via b7972767513c8748096ebed78d1e1621bd2bd459 (commit)
from 25d463c67821901c8fd6736c815f11e85bbae66f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b7972767513c8748096ebed78d1e1621bd2bd459
Author: Werner Koch <wk at gnupg.org>
Date: Sat Nov 12 11:06:22 2016 +0100
Add new interface gpgrt_get_syscall_clamp.
* src/visibility.c (gpgrt_get_syscall_clamp): New.
* src/gpg-error.vers, src/gpg-error.def.in: Add function.
* src/gpg-error.h.in: Ditto.
* src/estream.c (_gpgrt_get_syscall_clamp): New.
--
This function can be used by other libraries to set their own system
clamp functions.
Signed-off-by: Werner Koch <wk at gnupg.org>
diff --git a/NEWS b/NEWS
index b1c8c6c..3b373c5 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ Noteworthy changes in version 1.25 (unreleased) [C19/A19/R_)
GPG_ERR_DUP_NAME NEW.
GPG_ERR_TOO_OLD NEW.
GPG_ERR_TOO_YOUNG NEW.
+ gpgrt_get_syscall_clamp NEW.
Noteworthy changes in version 1.24 (2016-07-14) [C19/A19/R1)
diff --git a/src/estream.c b/src/estream.c
index d0f0ba9..752d22e 100644
--- a/src/estream.c
+++ b/src/estream.c
@@ -605,6 +605,17 @@ _gpgrt_set_syscall_clamp (void (*pre)(void), void (*post)(void))
_gpgrt_lock_set_lock_clamp (pre, post);
}
+/*
+ * Return the current sycall clamp functions. This can be used by
+ * other libraries which have blocking functions.
+ */
+void
+_gpgrt_get_syscall_clamp (void (**r_pre)(void), void (**r_post)(void))
+{
+ *r_pre = pre_syscall_func;
+ *r_post = post_syscall_func;
+}
+
/*
diff --git a/src/gpg-error.def.in b/src/gpg-error.def.in
index 1fa8866..19e87fa 100644
--- a/src/gpg-error.def.in
+++ b/src/gpg-error.def.in
@@ -150,4 +150,6 @@ EXPORTS
gpgrt_w32_iconv @111
#endif
+ gpgrt_get_syscall_clamp @112
+
;; end of file with public symbols for Windows.
diff --git a/src/gpg-error.h.in b/src/gpg-error.h.in
index a79f6ba..86f3241 100644
--- a/src/gpg-error.h.in
+++ b/src/gpg-error.h.in
@@ -303,6 +303,9 @@ void gpg_err_deinit (int mode);
/* Register blocking system I/O clamping functions. */
void gpgrt_set_syscall_clamp (void (*pre)(void), void (*post)(void));
+/* Get current I/O clamping functions. */
+void gpgrt_get_syscall_clamp (void (**r_pre)(void), void (**r_post)(void));
+
/* Register a custom malloc/realloc/free function. */
void gpgrt_set_alloc_func (void *(*f)(void *a, size_t n));
diff --git a/src/gpg-error.vers b/src/gpg-error.vers
index cdff0e3..802ff3d 100644
--- a/src/gpg-error.vers
+++ b/src/gpg-error.vers
@@ -39,6 +39,7 @@ GPG_ERROR_1.0 {
gpgrt_lock_trylock;
gpgrt_set_syscall_clamp;
+ gpgrt_get_syscall_clamp;
gpgrt_fopen;
gpgrt_mopen;
diff --git a/src/gpgrt-int.h b/src/gpgrt-int.h
index d69fe2c..b2b553b 100644
--- a/src/gpgrt-int.h
+++ b/src/gpgrt-int.h
@@ -53,6 +53,7 @@ gpg_err_code_t _gpgrt_yield (void);
/* Local prototypes for estream. */
int _gpgrt_es_init (void);
void _gpgrt_set_syscall_clamp (void (*pre)(void), void (*post)(void));
+void _gpgrt_get_syscall_clamp (void (**r_pre)(void), void (**r_post)(void));
gpgrt_stream_t _gpgrt_fopen (const char *_GPGRT__RESTRICT path,
const char *_GPGRT__RESTRICT mode);
diff --git a/src/visibility.c b/src/visibility.c
index e3ac8a7..89b5623 100644
--- a/src/visibility.c
+++ b/src/visibility.c
@@ -97,6 +97,12 @@ gpgrt_set_syscall_clamp (void (*pre)(void), void (*post)(void))
}
void
+gpgrt_get_syscall_clamp (void (**r_pre)(void), void (**r_post)(void))
+{
+ _gpgrt_get_syscall_clamp (r_pre, r_post);
+}
+
+void
gpgrt_set_alloc_func (void *(*f)(void *a, size_t n))
{
_gpgrt_set_alloc_func (f);
diff --git a/src/visibility.h b/src/visibility.h
index 1de6c62..479186f 100644
--- a/src/visibility.h
+++ b/src/visibility.h
@@ -142,6 +142,7 @@ MARK_VISIBLE (gpgrt_vbsprintf)
MARK_VISIBLE (gpgrt_snprintf)
MARK_VISIBLE (gpgrt_vsnprintf)
MARK_VISIBLE (gpgrt_set_syscall_clamp)
+MARK_VISIBLE (gpgrt_get_syscall_clamp)
MARK_VISIBLE (gpgrt_set_alloc_func)
#undef MARK_VISIBLE
@@ -251,6 +252,7 @@ MARK_VISIBLE (gpgrt_set_alloc_func)
#define gpgrt_vsnprintf _gpgrt_USE_UNDERSCORED_FUNCTION
#define gpgrt_set_syscall_clamp _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_get_syscall_clamp _gpgrt_USE_UNDERSCORED_FUNCTION
#define gpgrt_set_alloc_func _gpgrt_USE_UNDERSCORED_FUNCTION
-----------------------------------------------------------------------
Summary of changes:
NEWS | 1 +
src/estream.c | 11 +++++++++++
src/gpg-error.def.in | 2 ++
src/gpg-error.h.in | 3 +++
src/gpg-error.vers | 1 +
src/gpgrt-int.h | 1 +
src/visibility.c | 6 ++++++
src/visibility.h | 2 ++
8 files changed, 27 insertions(+)
hooks/post-receive
--
Error codes used by GnuPG et al.
http://git.gnupg.org
More information about the Gnupg-commits
mailing list