From 7ed876533aa7c8e721836c25cef737c3643f5e55 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Sun, 5 Jun 2005 18:13:38 +0000 Subject: New function, DSO_pathbyaddr, to find pathname for loaded shared object by an address within it. Tested on Linux, Solaris, IRIX, Tru64, Darwin, HP-UX, Win32, few BSD flavors... --- crypto/dso/dso_lib.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'crypto/dso/dso_lib.c') diff --git a/crypto/dso/dso_lib.c b/crypto/dso/dso_lib.c index 49bdd71309..0869a646f6 100644 --- a/crypto/dso/dso_lib.c +++ b/crypto/dso/dso_lib.c @@ -464,3 +464,15 @@ const char *DSO_get_loaded_filename(DSO *dso) } return(dso->loaded_filename); } + +int DSO_pathbyaddr(void *addr,char *path,int sz) + { + DSO_METHOD *meth = default_DSO_meth; + if (meth == NULL) meth = DSO_METHOD_openssl(); + if (meth->pathbyaddr == NULL) + { + DSOerr(DSO_F_PATHBYADDR,DSO_R_UNSUPPORTED); + return(NULL); + } + return (*meth->pathbyaddr)(addr,path,sz); + } -- cgit v1.2.3