PostgreSQL Source Code  git master
solaris.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * solaris.h
4  * port-specific prototypes for Solaris
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/backend/port/dynloader/solaris.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef PORT_PROTOS_H
15 #define PORT_PROTOS_H
16 
17 #include <dlfcn.h>
18 #include "utils/dynamic_loader.h" /* pgrminclude ignore */
19 
20 /*
21  * In some older systems, the RTLD_NOW flag isn't defined and the mode
22  * argument to dlopen must always be 1. The RTLD_GLOBAL flag is wanted
23  * if available, but it doesn't exist everywhere.
24  * If it doesn't exist, set it to 0 so it has no effect.
25  */
26 #ifndef RTLD_NOW
27 #define RTLD_NOW 1
28 #endif
29 #ifndef RTLD_GLOBAL
30 #define RTLD_GLOBAL 0
31 #endif
32 
33 #define pg_dlopen(f) dlopen((f), RTLD_NOW | RTLD_GLOBAL)
34 #define pg_dlsym dlsym
35 #define pg_dlclose dlclose
36 #define pg_dlerror dlerror
37 
38 #endif /* PORT_PROTOS_H */