3 /* This nice file makes Citadel/UX work with HP/UX's dynamic loader. */
4 /* It's unusual to put C code in a .h file, but I think it's easier for the
7 #ifndef _CITADEL_UX_HPSUX_H
8 #define _CITADEL_UX_HPSUX_H
17 void *dlopen(const char *, int);
19 const char *dlerror(void);
20 void *dlsym(void *, char *);
25 #define RTLD_LAZY BIND_DEFERRED
26 #define RTLD_NOW BIND_IMMEDIATE
27 #define RTLD_GLOBAL 0 /* This SEEMS to be the default for HP/UX */
30 /* extern variables */
35 static char *dlerrmsg; /* pointer to last error message */
38 /* functions mapped */
41 void *dlopen(const char *filename, int flag)
45 handle = shl_load(filename, flag, 0L);
47 dlerrmsg = strerror(errno);
48 return (void *)handle;
52 int dlclose(void *handle)
54 return shl_unload(handle);
58 /* I think this is as thread safe as it's going to get */
59 const char *dlerror(void)
69 void *dlsym(void *handle, char *symbol)
71 void *value = NULL; /* Linux man page says 0 is a valid symbol */
72 /* address. I don't understand this, of course, but what do I know? */
74 if (shl_findsym(handle, symbol, TYPE_UNDEFINED, value) == -1)
75 dlerrmsg = strerror(errno);
79 #endif /* _CITADEL_UX_HPSUX_H */