File tree Expand file tree Collapse file tree 2 files changed +34
-23
lines changed
src/backend/port/dynloader Expand file tree Collapse file tree 2 files changed +34
-23
lines changed Original file line number Diff line number Diff line change 1
1
/*-------------------------------------------------------------------------
2
2
*
3
- * dynloader .c
3
+ * linux .c
4
4
* Dynamic Loader for Postgres for Linux, generated from those for
5
5
* Ultrix.
6
6
*
11
11
*
12
12
*
13
13
* IDENTIFICATION
14
- * $Header: /cvsroot/pgsql/src/backend/port/dynloader/linux.c,v 1.22 2002/06/20 20:29:33 momjian Exp $
14
+ * $Header: /cvsroot/pgsql/src/backend/port/dynloader/linux.c,v 1.23 2002/10/15 16:04:17 tgl Exp $
15
15
*
16
16
*-------------------------------------------------------------------------
17
17
*/
18
18
19
19
#include "postgres.h"
20
+
20
21
#ifdef HAVE_DLD_H
21
- #include " dld.h"
22
+ #include < dld.h>
22
23
#endif
23
24
24
- #ifdef NOT_USED
25
- extern char pg_pathname [];
25
+ #include "dynloader.h"
26
+ #include "miscadmin.h"
27
+
28
+
29
+ #ifndef HAVE_DLOPEN
26
30
27
31
void *
28
32
pg_dlopen (char * filename )
@@ -98,8 +102,28 @@ pg_dlopen(char *filename)
98
102
#endif
99
103
}
100
104
105
+ PGFunction
106
+ pg_dlsym (void * handle , char * funcname )
107
+ {
108
+ #ifndef HAVE_DLD_H
109
+ return NULL ;
110
+ #else
111
+ return (PGFunction ) dld_get_func ((funcname ));
112
+ #endif
113
+ }
114
+
115
+ void
116
+ pg_dlclose (void * handle )
117
+ {
118
+ #ifndef HAVE_DLD_H
119
+ #else
120
+ dld_unlink_by_file (handle , 1 );
121
+ free (handle );
122
+ #endif
123
+ }
124
+
101
125
char *
102
- pg_dlerror ()
126
+ pg_dlerror (void )
103
127
{
104
128
#ifndef HAVE_DLD_H
105
129
return "dynaloader unspported" ;
@@ -108,4 +132,4 @@ pg_dlerror()
108
132
#endif
109
133
}
110
134
111
- #endif
135
+ #endif /* !HAVE_DLOPEN */
Original file line number Diff line number Diff line change 7
7
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
8
8
* Portions Copyright (c) 1994, Regents of the University of California
9
9
*
10
- * $Id: linux.h,v 1.18 2002/06/20 20:29:33 momjian Exp $
10
+ * $Id: linux.h,v 1.19 2002/10/15 16:04:17 tgl Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
20
20
#endif
21
21
22
22
23
- #ifndef HAVE_DLOPEN
24
-
25
- #ifndef HAVE_DLD_H
26
- #define pg_dlsym (handle , funcname ) (NULL)
27
- #define pg_dlclose (handle ) {}
28
- #else
29
- #define pg_dlsym (handle , funcname ) ((PGFunction) dld_get_func((funcname)))
30
- #define pg_dlclose (handle ) \
31
- do { \
32
- dld_unlink_by_file(handle, 1); \
33
- free(handle); \
34
- } while (0)
35
- #endif
36
-
37
- #else /* HAVE_DLOPEN */
23
+ #ifdef HAVE_DLOPEN
38
24
39
25
/*
40
26
* In some older systems, the RTLD_NOW flag isn't defined and the mode
53
39
#define pg_dlsym dlsym
54
40
#define pg_dlclose dlclose
55
41
#define pg_dlerror dlerror
42
+
56
43
#endif /* HAVE_DLOPEN */
57
44
58
45
#endif /* PORT_PROTOS_H */
You can’t perform that action at this time.
0 commit comments