summaryrefslogtreecommitdiff
path: root/src/backend/port/dynloader/aix.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-04-21 21:15:50 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-04-21 21:15:50 +0000
commitf2cc453dd7e87e800a62a173dea0353bf106668d (patch)
tree230e298f83472dc2ba26ca71fdb51b3b5f27a279 /src/backend/port/dynloader/aix.h
parentfea168823acd6c1c50d3d366798a4314c79e6dc9 (diff)
Remove the long-obsolete homebrew dl*() functions for AIX, in favor of just
using the system functions all the time. (These files are now just copies of the osf.* files.) The homebrew functions were not getting used anyway on AIX versions that have dlopen(), that is 4.3 and up, so they are not needed on any AIX that is even remotely supported by the vendor anymore. We'd have probably left them here anyway, except some questions were raised about the copyright.
Diffstat (limited to 'src/backend/port/dynloader/aix.h')
-rw-r--r--src/backend/port/dynloader/aix.h70
1 files changed, 23 insertions, 47 deletions
diff --git a/src/backend/port/dynloader/aix.h b/src/backend/port/dynloader/aix.h
index 29d385986e1..e4c82ad1281 100644
--- a/src/backend/port/dynloader/aix.h
+++ b/src/backend/port/dynloader/aix.h
@@ -1,63 +1,39 @@
-/*
- * $PostgreSQL: pgsql/src/backend/port/dynloader/aix.h,v 1.13 2005/10/15 02:49:23 momjian Exp $
+/*-------------------------------------------------------------------------
+ *
+ * aix.h
+ * prototypes for AIX-specific routines
+ *
+ *
+ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
*
- * @(#)dlfcn.h 1.4 revision of 95/04/25 09:36:52
- * This is an unpublished work copyright (c) 1992 HELIOS Software GmbH
- * 30159 Hannover, Germany
+ * $PostgreSQL: pgsql/src/backend/port/dynloader/aix.h,v 1.14 2009/04/21 21:15:50 tgl Exp $
+ *
+ *-------------------------------------------------------------------------
*/
#ifndef PORT_PROTOS_H
#define PORT_PROTOS_H
-#ifdef HAVE_DLOPEN
-
#include <dlfcn.h>
-#else /* HAVE_DLOPEN */
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/*
- * Mode flags for the dlopen routine.
- */
-#define RTLD_LAZY 1 /* lazy function call binding */
-#define RTLD_NOW 2 /* immediate function call binding */
-#define RTLD_GLOBAL 0x100 /* allow symbols to be global */
+#include "utils/dynamic_loader.h"
/*
- * To be able to intialize, a library may provide a dl_info structure
- * that contains functions to be called to initialize and terminate.
+ * In some older systems, the RTLD_NOW flag isn't defined and the mode
+ * argument to dlopen must always be 1. The RTLD_GLOBAL flag is wanted
+ * if available, but it doesn't exist everywhere.
+ * If it doesn't exist, set it to 0 so it has no effect.
*/
-struct dl_info
-{
- void (*init) (void);
- void (*fini) (void);
-};
-
-#if __STDC__ || defined(_IBMR2)
-void *dlopen(const char *path, int mode);
-void *dlsym(void *handle, const char *symbol);
-char *dlerror(void);
-int dlclose(void *handle);
-#else
-void *dlopen();
-void *dlsym();
-char *dlerror();
-int dlclose();
+#ifndef RTLD_NOW
+#define RTLD_NOW 1
#endif
-
-#ifdef __cplusplus
-}
+#ifndef RTLD_GLOBAL
+#define RTLD_GLOBAL 0
#endif
-#endif /* HAVE_DLOPEN */
-
-#include "utils/dynamic_loader.h"
#define pg_dlopen(f) dlopen((f), RTLD_NOW | RTLD_GLOBAL)
-#define pg_dlsym dlsym
-#define pg_dlclose dlclose
-#define pg_dlerror dlerror
+#define pg_dlsym(h, f) ((PGFunction) dlsym(h, f))
+#define pg_dlclose(h) dlclose(h)
+#define pg_dlerror() dlerror()
#endif /* PORT_PROTOS_H */