diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2018-09-06 10:07:24 +0200 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2018-09-06 11:33:04 +0200 |
commit | 842cb9fa62fc99598086166bdeec9d6ae6e3c50f (patch) | |
tree | a1c3c19d6d8eb66fd1b162fcf616e711ea2cafd1 /src/backend/port/dynloader/hpux.c | |
parent | ac27c74def5d8544530b13d5901308a342f072ac (diff) |
Refactor dlopen() support
Nowadays, all platforms except Windows and older HP-UX have standard
dlopen() support. So having a separate implementation per platform
under src/backend/port/dynloader/ is a bit excessive. Instead, treat
dlopen() like other library functions that happen to be missing
sometimes and put a replacement implementation under src/port/.
Discussion: https://www.postgresql.org/message-id/flat/e11a49cb-570a-60b7-707d-7084c8de0e61%402ndquadrant.com#54e735ae37476a121abb4e33c2549b03
Diffstat (limited to 'src/backend/port/dynloader/hpux.c')
-rw-r--r-- | src/backend/port/dynloader/hpux.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/src/backend/port/dynloader/hpux.c b/src/backend/port/dynloader/hpux.c deleted file mode 100644 index d82dd7603bf..00000000000 --- a/src/backend/port/dynloader/hpux.c +++ /dev/null @@ -1,68 +0,0 @@ -/*------------------------------------------------------------------------- - * - * dynloader.c - * dynamic loader for HP-UX using the shared library mechanism - * - * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * - * IDENTIFICATION - * src/backend/port/dynloader/hpux.c - * - * NOTES - * all functions are defined here -- it's impossible to trace the - * shl_* routines from the bundled HP-UX debugger. - * - *------------------------------------------------------------------------- - */ -#include "postgres.h" - -/* System includes */ -#include <a.out.h> -#include <dl.h> - -#include "dynloader.h" -#include "utils/dynamic_loader.h" - -void * -pg_dlopen(const char *filename) -{ - /* - * Use BIND_IMMEDIATE so that undefined symbols cause a failure return - * from shl_load(), rather than an abort() later on when we attempt to - * call the library! - */ - shl_t handle = shl_load(filename, - BIND_IMMEDIATE | BIND_VERBOSE | DYNAMIC_PATH, - 0L); - - return (void *) handle; -} - -PGFunction -pg_dlsym(void *handle, const char *funcname) -{ - PGFunction f; - - if (shl_findsym((shl_t *) & handle, funcname, TYPE_PROCEDURE, &f) == -1) - f = (PGFunction) NULL; - return f; -} - -void -pg_dlclose(void *handle) -{ - shl_unload((shl_t) handle); -} - -char * -pg_dlerror(void) -{ - static char errmsg[] = "shl_load failed"; - - if (errno) - return strerror(errno); - - return errmsg; -} |