]> granicus.if.org Git - postgresql/blob - src/backend/port/dynloader/aix.h
e2e59805e43496f690580f744a9288de9d07f94e
[postgresql] / src / backend / port / dynloader / aix.h
1 /*-------------------------------------------------------------------------
2  *
3  * aix.h
4  *        prototypes for AIX-specific routines
5  *
6  *
7  * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * $PostgreSQL: pgsql/src/backend/port/dynloader/aix.h,v 1.15 2010/01/02 16:57:50 momjian Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14
15 #ifndef PORT_PROTOS_H
16 #define PORT_PROTOS_H
17
18 #include <dlfcn.h>
19 #include "utils/dynamic_loader.h"
20
21 /*
22  * In some older systems, the RTLD_NOW flag isn't defined and the mode
23  * argument to dlopen must always be 1.  The RTLD_GLOBAL flag is wanted
24  * if available, but it doesn't exist everywhere.
25  * If it doesn't exist, set it to 0 so it has no effect.
26  */
27 #ifndef RTLD_NOW
28 #define RTLD_NOW 1
29 #endif
30 #ifndef RTLD_GLOBAL
31 #define RTLD_GLOBAL 0
32 #endif
33
34 #define  pg_dlopen(f)   dlopen((f), RTLD_NOW | RTLD_GLOBAL)
35 #define  pg_dlsym(h, f) ((PGFunction) dlsym(h, f))
36 #define  pg_dlclose(h)  dlclose(h)
37 #define  pg_dlerror()   dlerror()
38
39 #endif   /* PORT_PROTOS_H */