OSDN Git Service

Update copyrights to 2003.
[pg-rex/syncrep.git] / src / backend / port / dynloader / irix5.h
index a7fcfa9..02d7887 100644 (file)
@@ -1,12 +1,13 @@
 /*-------------------------------------------------------------------------
  *
- * port-protos.h--
+ * irix5.h
  *       port-specific prototypes for Irix 5
  *
  *
- * Copyright (c) 1994, Regents of the University of California
+ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
  *
- * port-protos.h,v 1.2 1995/03/17 06:40:18 andrew Exp
+ * $Id: irix5.h,v 1.14 2003/08/04 02:40:02 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 #define PORT_PROTOS_H
 
 #include <dlfcn.h>
-#include "fmgr.h"                              /* for func_ptr */
 #include "utils/dynamic_loader.h"
 
-/* dynloader.c */
 /*
  * Dynamic Loader on SunOS 4.
  *
  * this dynamic loader uses the system dynamic loading interface for shared
  * libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared
  * library as the file to be dynamically loaded.
- *
  */
-#define pg_dlopen(f)   dlopen(f,1)
+
+/*
+ * 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.
+ */
+#ifndef RTLD_NOW
+#define RTLD_NOW 1
+#endif
+#ifndef RTLD_GLOBAL
+#define RTLD_GLOBAL 0
+#endif
+
+#define pg_dlopen(f)   dlopen((f), RTLD_NOW | RTLD_GLOBAL)
 #define pg_dlsym               dlsym
 #define pg_dlclose             dlclose
 #define pg_dlerror             dlerror
 
-#endif                                                 /* PORT_PROTOS_H */
+#endif   /* PORT_PROTOS_H */