summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-03-19 07:08:02 +0000
committerJeremy Allison <jra@samba.org>2001-03-19 07:08:02 +0000
commitc7a953a3188ccb6dfbe49ea66304b3d517b0c628 (patch)
treef24e442f81ee263e0981155b1ef6fc1c4f887df8 /source3/lib
parent62711a9ceb375fef2c0af0f649d8c77eb94483f9 (diff)
downloadsamba-c7a953a3188ccb6dfbe49ea66304b3d517b0c628.tar.gz
samba-c7a953a3188ccb6dfbe49ea66304b3d517b0c628.tar.bz2
samba-c7a953a3188ccb6dfbe49ea66304b3d517b0c628.zip
Added sys_dlopen/sys_dlsym/sys_dlclose.
Jeremy. (This used to be commit 49f0e7e7143f82bce9dfd8b06e9e515bc0869ab7)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/system.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 38b2e79ac6..91f4f8a333 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -1081,3 +1081,34 @@ int sys_pclose(int fd)
return -1;
return wstatus;
}
+
+/**************************************************************************
+ Wrappers for dlopen, dlsym, dlclose.
+****************************************************************************/
+
+void *sys_dlopen(const char *name, int flags)
+{
+#ifdef HAVE_LIBDL
+ return dlopen(name, flags);
+#else
+ return NULL;
+#endif
+}
+
+void *sys_dlsym(void *handle, char *symbol)
+{
+#ifdef HAVE_LIBDL
+ return dlsym(handle, symbol);
+#else
+ return NULL;
+#endif
+}
+
+int sys_dlclose (void *handle)
+{
+#ifdef HAVE_LIBDL
+ return dlclose(handle);
+#else
+ return 0;
+#endif
+}