Header And Logo

PostgreSQL
| The world's most advanced open source database.

linux.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * linux.h
00004  *      Port-specific prototypes for Linux
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/linux.h
00011  *
00012  *-------------------------------------------------------------------------
00013  */
00014 #ifndef PORT_PROTOS_H
00015 #define PORT_PROTOS_H
00016 
00017 #include "utils/dynamic_loader.h"       /* pgrminclude ignore */
00018 #ifdef HAVE_DLOPEN
00019 #include <dlfcn.h>
00020 #endif
00021 
00022 
00023 #ifdef HAVE_DLOPEN
00024 
00025 /*
00026  * In some older systems, the RTLD_NOW flag isn't defined and the mode
00027  * argument to dlopen must always be 1.  The RTLD_GLOBAL flag is wanted
00028  * if available, but it doesn't exist everywhere.
00029  * If it doesn't exist, set it to 0 so it has no effect.
00030  */
00031 #ifndef RTLD_NOW
00032 #define RTLD_NOW 1
00033 #endif
00034 #ifndef RTLD_GLOBAL
00035 #define RTLD_GLOBAL 0
00036 #endif
00037 
00038 #define pg_dlopen(f)    dlopen((f), RTLD_NOW | RTLD_GLOBAL)
00039 #define pg_dlsym        dlsym
00040 #define pg_dlclose      dlclose
00041 #define pg_dlerror      dlerror
00042 #endif   /* HAVE_DLOPEN */
00043 
00044 #endif   /* PORT_PROTOS_H */