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