1 /*-------------------------------------------------------------------------
4 * Dynamic loader interface for BSD/OS
6 * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
11 *-------------------------------------------------------------------------
16 #include "utils/dynamic_loader.h"
24 * In some older systems, the RTLD_NOW flag isn't defined and the mode
25 * argument to dlopen must always be 1. The RTLD_GLOBAL flag is wanted
26 * if available, but it doesn't exist everywhere.
27 * If it doesn't exist, set it to 0 so it has no effect.
36 #define pg_dlopen(f) dlopen((f), RTLD_NOW | RTLD_GLOBAL)
37 #define pg_dlsym dlsym
38 #define pg_dlclose dlclose
39 #define pg_dlerror dlerror
40 #else /* not HAVE_DLOPEN */
42 #define pg_dlsym(handle, funcname) ((PGFunction) dld_get_func((funcname)))
43 #define pg_dlclose(handle) \
45 dld_unlink_by_file(handle, 1); \
48 #endif /* not HAVE_DLOPEN */
50 #endif /* PORT_PROTOS_H */