summaryrefslogtreecommitdiff
path: root/src/backend/port/dynloader/aix.h
blob: f34d07b06531a031f7a3e2fc8d18accce93e6d17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
 * $Id: aix.h,v 1.5 2001/03/22 03:59:42 momjian Exp $
 *
 * @(#)dlfcn.h	1.4 revision of 95/04/25  09:36:52
 * This is an unpublished work copyright (c) 1992 HELIOS Software GmbH
 * 30159 Hannover, Germany
 */

#ifndef PORT_PROTOS_H
#define PORT_PROTOS_H

#ifdef HAVE_DLOPEN

#include <dlfcn.h>

#else							/* HAVE_DLOPEN */

#ifdef __cplusplus
extern		"C"
{
#endif

/*
 * Mode flags for the dlopen routine.
 */
#define RTLD_LAZY		1		/* lazy function call binding */
#define RTLD_NOW		2		/* immediate function call binding */
#define RTLD_GLOBAL		0x100	/* allow symbols to be global */

/*
 * To be able to intialize, a library may provide a dl_info structure
 * that contains functions to be called to initialize and terminate.
 */
	struct dl_info
	{
		void		(*init) (void);
		void		(*fini) (void);
	};

#if __STDC__ || defined(_IBMR2)
	void	   *dlopen(const char *path, int mode);
	void	   *dlsym(void *handle, const char *symbol);
	char	   *dlerror(void);
	int			dlclose(void *handle);
#else
	void	   *dlopen();
	void	   *dlsym();
	char	   *dlerror();
	int			dlclose();
#endif

#ifdef __cplusplus
}

#endif

#endif	 /* HAVE_DLOPEN */

#include "utils/dynamic_loader.h"

#define  pg_dlopen(f)	dlopen(f, RTLD_LAZY)
#define  pg_dlsym	dlsym
#define  pg_dlclose dlclose
#define  pg_dlerror dlerror

#endif	 /* PORT_PROTOS_H */