aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/dynload.c
diff options
context:
space:
mode:
Diffstat (limited to 'cipher/dynload.c')
-rw-r--r--cipher/dynload.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/cipher/dynload.c b/cipher/dynload.c
index 6caeb063c..e2c988e02 100644
--- a/cipher/dynload.c
+++ b/cipher/dynload.c
@@ -27,6 +27,9 @@
#include <dlfcn.h>
#elif defined(HAVE_DLD_DLD_LINK)
#include <dld.h>
+#elif defined(HAVE_DL_SHL_LOAD)
+ #include <dl.h>
+ #include <errno.h>
#endif
#include "util.h"
#include "cipher.h"
@@ -45,6 +48,27 @@
#define RTLD_NOW 1
#endif
+#ifdef HAVE_DL_SHL_LOAD /* HPUX has shl_load instead of dlopen */
+#define HAVE_DL_DLOPEN
+#define dlopen(PATHNAME,MODE) \
+ ((void *) shl_load(PATHNAME, DYNAMIC_PATH | \
+ (((MODE) & RTLD_NOW) ? BIND_IMMEDIATE : BIND_DEFERRED), 0L))
+#define dlclose(HANDLE) shl_unload((shl_t) (HANDLE))
+#define dlerror() (errno == 0 ? NULL : strerror(errno))
+
+static void *
+dlsym(void *handle, char *name)
+{
+ void *addr;
+ if (shl_findsym((shl_t *)&handle,name,(short)TYPE_UNDEFINED,&addr) != 0) {
+ return NULL;
+ }
+ return addr;
+}
+#endif /*HAVE_DL_SHL_LOAD*/
+
+
+
typedef struct ext_list {
struct ext_list *next;
int internal;