summaryrefslogtreecommitdiff
path: root/src/backend/port
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2018-07-10 15:50:28 +0200
committerPeter Eisentraut <peter_e@gmx.net>2018-08-13 23:21:01 +0200
commit351855fc4ebc2b5e62565f63ddbedbcada80e532 (patch)
tree86734e18e8b0578834a0b663efb8dd93d9bbcb65 /src/backend/port
parentb5d29299ccad9b2385236f2b82a0c4e1365b9add (diff)
downloadpostgresql-351855fc4ebc2b5e62565f63ddbedbcada80e532.tar.gz
Remove obsolete linux dynloader code
This has been obsolete probably since the late 1990s.
Diffstat (limited to 'src/backend/port')
-rw-r--r--src/backend/port/dynloader/linux.c134
-rw-r--r--src/backend/port/dynloader/linux.h6
2 files changed, 4 insertions, 136 deletions
diff --git a/src/backend/port/dynloader/linux.c b/src/backend/port/dynloader/linux.c
index 8735767add..2126576e8f 100644
--- a/src/backend/port/dynloader/linux.c
+++ b/src/backend/port/dynloader/linux.c
@@ -1,133 +1,7 @@
-/*-------------------------------------------------------------------------
+/*
+ * src/backend/port/dynloader/linux.c
*
- * linux.c
- * Dynamic Loader for Postgres for Linux, generated from those for
- * Ultrix.
+ * Dummy file used for nothing at this point
*
- * You need to install the dld library on your Linux system!
- *
- * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- *
- * IDENTIFICATION
- * src/backend/port/dynloader/linux.c
- *
- *-------------------------------------------------------------------------
+ * see linux.h
*/
-
-#include "postgres.h"
-
-#ifdef HAVE_DLD_H
-#include <dld.h>
-#endif
-
-#include "dynloader.h"
-#include "miscadmin.h"
-
-
-#ifndef HAVE_DLOPEN
-
-void *
-pg_dlopen(const char *filename)
-{
-#ifndef HAVE_DLD_H
- elog(ERROR, "dynamic load not supported");
- return NULL;
-#else
- static int dl_initialized = 0;
-
- /*
- * initializes the dynamic loader with the executable's pathname. (only
- * needs to do this the first time pg_dlopen is called.)
- */
- if (!dl_initialized)
- {
- if (dld_init(dld_find_executable(my_exec_path)))
- return NULL;
-
- /*
- * if there are undefined symbols, we want dl to search from the
- * following libraries also.
- */
- dl_initialized = 1;
- }
-
- /*
- * link the file, then check for undefined symbols!
- */
- if (dld_link(filename))
- return NULL;
-
- /*
- * If undefined symbols: try to link with the C and math libraries! This
- * could be smarter, if the dynamic linker was able to handle shared libs!
- */
- if (dld_undefined_sym_count > 0)
- {
- if (dld_link("/usr/lib/libc.a"))
- {
- elog(WARNING, "could not link C library");
- return NULL;
- }
- if (dld_undefined_sym_count > 0)
- {
- if (dld_link("/usr/lib/libm.a"))
- {
- elog(WARNING, "could not link math library");
- return NULL;
- }
- if (dld_undefined_sym_count > 0)
- {
- int count = dld_undefined_sym_count;
- char **list = dld_list_undefined_sym();
-
- /* list the undefined symbols, if any */
- do
- {
- elog(WARNING, "\"%s\" is undefined", *list);
- list++;
- count--;
- } while (count > 0);
-
- dld_unlink_by_file(filename, 1);
- return NULL;
- }
- }
- }
-
- return (void *) strdup(filename);
-#endif
-}
-
-PGFunction
-pg_dlsym(void *handle, const char *funcname)
-{
-#ifndef HAVE_DLD_H
- return NULL;
-#else
- return (PGFunction) dld_get_func((funcname));
-#endif
-}
-
-void
-pg_dlclose(void *handle)
-{
-#ifndef HAVE_DLD_H
-#else
- dld_unlink_by_file(handle, 1);
- free(handle);
-#endif
-}
-
-char *
-pg_dlerror(void)
-{
-#ifndef HAVE_DLD_H
- return "dynaloader unsupported";
-#else
- return dld_strerror(dld_errno);
-#endif
-}
-
-#endif /* !HAVE_DLOPEN */
diff --git a/src/backend/port/dynloader/linux.h b/src/backend/port/dynloader/linux.h
index df2852ac58..6beb3d63f8 100644
--- a/src/backend/port/dynloader/linux.h
+++ b/src/backend/port/dynloader/linux.h
@@ -15,12 +15,7 @@
#define PORT_PROTOS_H
#include "utils/dynamic_loader.h" /* pgrminclude ignore */
-#ifdef HAVE_DLOPEN
#include <dlfcn.h>
-#endif
-
-
-#ifdef HAVE_DLOPEN
/*
* In some older systems, the RTLD_NOW flag isn't defined and the mode
@@ -39,6 +34,5 @@
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
-#endif /* HAVE_DLOPEN */
#endif /* PORT_PROTOS_H */