00001 /*------------------------------------------------------------------------- 00002 * 00003 * osf.h 00004 * prototypes for OSF/1-specific routines 00005 * 00006 * 00007 * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group 00008 * Portions Copyright (c) 1994, Regents of the University of California 00009 * 00010 * src/backend/port/dynloader/osf.h 00011 * 00012 *------------------------------------------------------------------------- 00013 */ 00014 00015 #ifndef PORT_PROTOS_H 00016 #define PORT_PROTOS_H 00017 00018 #include <dlfcn.h> 00019 #include "utils/dynamic_loader.h" /* pgrminclude ignore */ 00020 00021 /* 00022 * Dynamic Loader on Alpha OSF/1.x 00023 * 00024 * this dynamic loader uses the system dynamic loading interface for shared 00025 * libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared 00026 * library as the file to be dynamically loaded. 00027 */ 00028 00029 /* 00030 * In some older systems, the RTLD_NOW flag isn't defined and the mode 00031 * argument to dlopen must always be 1. The RTLD_GLOBAL flag is wanted 00032 * if available, but it doesn't exist everywhere. 00033 * If it doesn't exist, set it to 0 so it has no effect. 00034 */ 00035 #ifndef RTLD_NOW 00036 #define RTLD_NOW 1 00037 #endif 00038 #ifndef RTLD_GLOBAL 00039 #define RTLD_GLOBAL 0 00040 #endif 00041 00042 #define pg_dlopen(f) dlopen((f), RTLD_NOW | RTLD_GLOBAL) 00043 #define pg_dlsym(h, f) ((PGFunction) dlsym(h, f)) 00044 #define pg_dlclose(h) dlclose(h) 00045 #define pg_dlerror() dlerror() 00046 00047 #endif /* PORT_PROTOS_H */