Fix xslt_process() to ensure that it inserts a NULL terminator after the
[PostgreSQL.git] / src / backend / port / dynloader / linux.h
blob9c1a093d5e036af3c570598f09838e1957a6a58e
1 /*-------------------------------------------------------------------------
3 * linux.h
4 * Port-specific prototypes for Linux
7 * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * $PostgreSQL$
12 *-------------------------------------------------------------------------
14 #ifndef PORT_PROTOS_H
15 #define PORT_PROTOS_H
17 #include "utils/dynamic_loader.h"
18 #ifdef HAVE_DLOPEN
19 #include <dlfcn.h>
20 #endif
23 #ifdef HAVE_DLOPEN
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.
31 #ifndef RTLD_NOW
32 #define RTLD_NOW 1
33 #endif
34 #ifndef RTLD_GLOBAL
35 #define RTLD_GLOBAL 0
36 #endif
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 */
44 #endif /* PORT_PROTOS_H */