diff options
author | Marc G. Fournier <scrappy@hub.org> | 1996-07-09 06:22:35 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1996-07-09 06:22:35 +0000 |
commit | d31084e9d1118b25fd16580d9d8c2924b5740dff (patch) | |
tree | 3179e66307d54df9c7b966543550e601eb55e668 /src/backend/port/hpux/dynloader.c | |
download | postgresql-PG95-1_01.tar.gz postgresql-PG95-1_01.zip |
Postgres95 1.01 Distribution - Virgin SourcesPG95-1_01
Diffstat (limited to 'src/backend/port/hpux/dynloader.c')
-rw-r--r-- | src/backend/port/hpux/dynloader.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/backend/port/hpux/dynloader.c b/src/backend/port/hpux/dynloader.c new file mode 100644 index 00000000000..deea2e1dc29 --- /dev/null +++ b/src/backend/port/hpux/dynloader.c @@ -0,0 +1,57 @@ +/*------------------------------------------------------------------------- + * + * dynloader.c-- + * dynamic loader for HP-UX using the shared library mechanism + * + * Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/backend/port/hpux/Attic/dynloader.c,v 1.1.1.1 1996/07/09 06:21:43 scrappy Exp $ + * + * NOTES + * all functions are defined here -- it's impossible to trace the + * shl_* routines from the bundled HP-UX debugger. + * + *------------------------------------------------------------------------- + */ +/* System includes */ +#include <stdio.h> +#include <a.out.h> +#include <dl.h> +#include "c.h" +#include "fmgr.h" +#include "utils/dynamic_loader.h" +#include "port-protos.h" + +void * +pg_dlopen(char *filename) +{ + shl_t handle = shl_load(filename, BIND_DEFERRED, 0); + + return((void *) handle); +} + +func_ptr +pg_dlsym(void *handle, char *funcname) +{ + func_ptr f; + + if (shl_findsym((shl_t *) &handle, funcname, TYPE_PROCEDURE, &f) == -1) { + f = (func_ptr) NULL; + } + return(f); +} + +void +pg_dlclose(void *handle) +{ + shl_unload((shl_t) handle); +} + +char * +pg_dlerror() +{ + static char errmsg[]= "shl_load failed"; + return errmsg; +} |