]> granicus.if.org Git - postgresql/blob - src/backend/port/dynloader/linux.h
Update copyrights to 2003.
[postgresql] / src / backend / port / dynloader / linux.h
1 /*-------------------------------------------------------------------------
2  *
3  * linux.h
4  *              Port-specific prototypes for Linux
5  *
6  *
7  * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * $Id: linux.h,v 1.21 2003/08/04 02:40:02 momjian Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef PORT_PROTOS_H
15 #define PORT_PROTOS_H
16
17 #include "utils/dynamic_loader.h"
18 #ifdef HAVE_DLOPEN
19 #include <dlfcn.h>
20 #endif
21
22
23 #ifdef HAVE_DLOPEN
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 */