public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/master-posix_clock] support: Add xdlvsym function
@ 2019-07-02 17:25 Adhemerval Zanella
0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2019-07-02 17:25 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=17432d7150bdab3bce2ea66c70ad6c920f54077a
commit 17432d7150bdab3bce2ea66c70ad6c920f54077a
Author: Florian Weimer <fweimer@redhat.com>
Date: Fri Jun 28 10:15:30 2019 +0200
support: Add xdlvsym function
Diff:
---
ChangeLog | 5 +++++
support/xdlfcn.c | 20 ++++++++++++++++++++
support/xdlfcn.h | 1 +
3 files changed, 26 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index a354988..07d1bd6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2019-06-28 Florian Weimer <fweimer@redhat.com>
+ * support/xdlfcn.h (xdlvsym): Declare function.
+ * support/xdlfcn.c (xdlvsym): Define funciton.
+
+2019-06-28 Florian Weimer <fweimer@redhat.com>
+
[BZ #24744]
io: Remove the copy_file_range emulation.
* sysdeps/unix/sysv/linux/copy_file_range.c (copy_file_range): Do
diff --git a/support/xdlfcn.c b/support/xdlfcn.c
index b2e5c21..11fe489 100644
--- a/support/xdlfcn.c
+++ b/support/xdlfcn.c
@@ -51,6 +51,26 @@ xdlsym (void *handle, const char *symbol)
return sym;
}
+void *
+xdlvsym (void *handle, const char *symbol, const char *version)
+{
+ /* Clear any pending errors. */
+ dlerror ();
+
+ void *sym = dlvsym (handle, symbol, version);
+
+ if (sym == NULL)
+ {
+ const char *error = dlerror ();
+ if (error != NULL)
+ FAIL_EXIT1 ("error: dlvsym: %s\n", error);
+ /* If there was no error, we found a NULL symbol. Return the
+ NULL value in this case. */
+ }
+
+ return sym;
+}
+
void
xdlclose (void *handle)
{
diff --git a/support/xdlfcn.h b/support/xdlfcn.h
index c9cd810..7f8d493 100644
--- a/support/xdlfcn.h
+++ b/support/xdlfcn.h
@@ -27,6 +27,7 @@ __BEGIN_DECLS
void *xdlopen (const char *filename, int flags);
void *xdlmopen (Lmid_t lmid, const char *filename, int flags);
void *xdlsym (void *handle, const char *symbol);
+void *xdlvsym (void *handle, const char *symbol, const char *version);
void xdlclose (void *handle);
__END_DECLS
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-07-02 17:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-02 17:25 [glibc/azanella/master-posix_clock] support: Add xdlvsym function Adhemerval Zanella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).