diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-01-05 17:41:01 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-01-05 17:41:01 +1100 |
commit | 370779a1bb0218f31d02f0976e143d4b5d84b3d4 (patch) | |
tree | fd466f27d5334c23eff9dbb61c304e014e868ae9 /ctdb/lib/replace/dlfcn.c | |
parent | 67d2b14d908498b28bf19febc958cbf5f91cc1ec (diff) | |
download | samba-370779a1bb0218f31d02f0976e143d4b5d84b3d4.tar.gz samba-370779a1bb0218f31d02f0976e143d4b5d84b3d4.tar.xz samba-370779a1bb0218f31d02f0976e143d4b5d84b3d4.zip |
update from Samba4
(This used to be ctdb commit 298118c41bd33acd1a34a35a71a28451a45390c5)
Diffstat (limited to 'ctdb/lib/replace/dlfcn.c')
-rw-r--r-- | ctdb/lib/replace/dlfcn.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ctdb/lib/replace/dlfcn.c b/ctdb/lib/replace/dlfcn.c index 46aaaa4087..42848848e8 100644 --- a/ctdb/lib/replace/dlfcn.c +++ b/ctdb/lib/replace/dlfcn.c @@ -23,6 +23,9 @@ */ #include "replace.h" +#ifdef HAVE_DL_H +#include <dl.h> +#endif #ifndef HAVE_DLOPEN #ifdef DLOPEN_TAKES_UNSIGNED_FLAGS @@ -31,13 +34,22 @@ void *rep_dlopen(const char *name, unsigned int flags) void *rep_dlopen(const char *name, int flags) #endif { +#ifdef HAVE_SHL_LOAD + return (void *)shl_load(name, flags, 0); +#else return NULL; +#endif } #endif #ifndef HAVE_DLSYM void *rep_dlsym(void *handle, const char *symbol) { +#ifdef HAVE_SHL_FINDSYM + void *sym_addr; + if (!shl_findsym((shl_t *)&handle, symbol, TYPE_UNDEFINED, &sym_addr)) + return sym_addr; +#endif return NULL; } #endif @@ -52,6 +64,10 @@ char *rep_dlerror(void) #ifndef HAVE_DLCLOSE int rep_dlclose(void *handle) { +#ifdef HAVE_SHL_CLOSE + return shl_unload((shl_t)handle); +#else return 0; +#endif } #endif |