Force a checkpoint in CREATE DATABASE before starting to copy the files,
[PostgreSQL.git] / src / backend / port / dynloader / freebsd.h
blobcf8c2be99784c2e0486cf02ad9603de6be8a03e3
1 /*-------------------------------------------------------------------------
3 * freebsd.h
4 * port-specific prototypes for FreeBSD
6 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
9 * $PostgreSQL$
11 *-------------------------------------------------------------------------
13 #ifndef PORT_PROTOS_H
14 #define PORT_PROTOS_H
16 #include <sys/types.h>
17 #include <nlist.h>
18 #include <link.h>
19 #include <dlfcn.h>
21 #include "utils/dynamic_loader.h"
24 * Dynamic Loader on NetBSD 1.0.
26 * this dynamic loader uses the system dynamic loading interface for shared
27 * libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared
28 * library as the file to be dynamically loaded.
30 * agc - I know this is all a bit crufty, but it does work, is fairly
31 * portable, and works (the stipulation that the d.l. function must
32 * begin with an underscore is fairly tricky, and some versions of
33 * NetBSD (like 1.0, and 1.0A pre June 1995) have no dlerror.)
37 * In some older systems, the RTLD_NOW flag isn't defined and the mode
38 * argument to dlopen must always be 1. The RTLD_GLOBAL flag is wanted
39 * if available, but it doesn't exist everywhere.
40 * If it doesn't exist, set it to 0 so it has no effect.
42 #ifndef RTLD_NOW
43 #define RTLD_NOW 1
44 #endif
45 #ifndef RTLD_GLOBAL
46 #define RTLD_GLOBAL 0
47 #endif
49 #define pg_dlopen(f) BSD44_derived_dlopen((f), RTLD_NOW | RTLD_GLOBAL)
50 #define pg_dlsym BSD44_derived_dlsym
51 #define pg_dlclose BSD44_derived_dlclose
52 #define pg_dlerror BSD44_derived_dlerror
54 char *BSD44_derived_dlerror(void);
55 void *BSD44_derived_dlopen(const char *filename, int num);
56 void *BSD44_derived_dlsym(void *handle, const char *name);
57 void BSD44_derived_dlclose(void *handle);
59 #endif /* PORT_PROTOS_H */