1 /*-------------------------------------------------------------------------
4 * dynamic loader for HP-UX using the shared library mechanism
6 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
14 * all functions are defined here -- it's impossible to trace the
15 * shl_* routines from the bundled HP-UX debugger.
17 *-------------------------------------------------------------------------
25 #include "dynloader.h"
26 #include "utils/dynamic_loader.h"
29 pg_dlopen(char *filename
)
32 * Use BIND_IMMEDIATE so that undefined symbols cause a failure return
33 * from shl_load(), rather than an abort() later on when we attempt to
36 shl_t handle
= shl_load(filename
,
37 BIND_IMMEDIATE
| BIND_VERBOSE
| DYNAMIC_PATH
,
40 return (void *) handle
;
44 pg_dlsym(void *handle
, char *funcname
)
48 if (shl_findsym((shl_t
*) & handle
, funcname
, TYPE_PROCEDURE
, &f
) == -1)
49 f
= (PGFunction
) NULL
;
54 pg_dlclose(void *handle
)
56 shl_unload((shl_t
) handle
);
62 static char errmsg
[] = "shl_load failed";
65 return strerror(errno
);