Skip to content

Commit 527f8ba

Browse files
committed
From: Brian E Gallew <geek+@cmu.edu>
dgux 5.4R4.11 Missing port-protos.h (not needed, I think). Wants dld.h. Should really use the system dl stuff (like i386_solaris). Needs to include <netinet/in.h> before <arpa/inet.h>. Here are some patches...
1 parent d1891c6 commit 527f8ba

File tree

3 files changed

+22
-109
lines changed

3 files changed

+22
-109
lines changed

src/backend/port/dynloader/dgux.c

Lines changed: 3 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,7 @@
1-
/*-------------------------------------------------------------------------
1+
/* Dummy file used for nothing at this point
22
*
3-
* dynloader.c--
4-
* Dynamic Loader for Postgres for DG/UX, generated from those for
5-
* Linux.
3+
* see dgux.h
64
*
7-
* Copyright (c) 1994, Regents of the University of California
8-
*
9-
*
10-
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/dgux.c,v 1.1 1997/12/20 04:48:02 scrappy Exp $
12-
*
13-
*-------------------------------------------------------------------------
5+
* $Id: dgux.c,v 1.2 1998/02/14 19:56:19 scrappy Exp $
146
*/
15-
#include <stdio.h>
16-
#include <dld.h>
17-
#include "postgres.h"
18-
#include "port-protos.h"
19-
#include "utils/elog.h"
20-
#include "fmgr.h"
21-
22-
extern char pg_pathname[];
23-
24-
void *
25-
pg_dlopen(char *filename)
26-
{
27-
static int dl_initialized = 0;
28-
29-
/*
30-
* initializes the dynamic loader with the executable's pathname.
31-
* (only needs to do this the first time pg_dlopen is called.)
32-
*/
33-
if (!dl_initialized)
34-
{
35-
if (dld_init(dld_find_executable(pg_pathname)))
36-
{
37-
return NULL;
38-
}
39-
40-
/*
41-
* if there are undefined symbols, we want dl to search from the
42-
* following libraries also.
43-
*/
44-
dl_initialized = 1;
45-
}
46-
47-
/*
48-
* link the file, then check for undefined symbols!
49-
*/
50-
if (dld_link(filename))
51-
{
52-
return NULL;
53-
}
54-
55-
/*
56-
* If undefined symbols: try to link with the C and math libraries!
57-
* This could be smarter, if the dynamic linker was able to handle
58-
* shared libs!
59-
*/
60-
if (dld_undefined_sym_count > 0)
61-
{
62-
if (dld_link("/usr/lib/libc.a"))
63-
{
64-
elog(NOTICE, "dld: Cannot link C library!");
65-
return NULL;
66-
}
67-
if (dld_undefined_sym_count > 0)
68-
{
69-
if (dld_link("/usr/lib/libm.a"))
70-
{
71-
elog(NOTICE, "dld: Cannot link math library!");
72-
return NULL;
73-
}
74-
if (dld_undefined_sym_count > 0)
75-
{
76-
int count = dld_undefined_sym_count;
77-
char **list = dld_list_undefined_sym();
78-
79-
/* list the undefined symbols, if any */
80-
elog(NOTICE, "dld: Undefined:");
81-
do
82-
{
83-
elog(NOTICE, " %s", *list);
84-
list++;
85-
count--;
86-
} while (count > 0);
87-
88-
dld_unlink_by_file(filename, 1);
89-
return NULL;
90-
}
91-
}
92-
}
93-
94-
return (void *) strdup(filename);
95-
}
967

97-
char *
98-
pg_dlerror()
99-
{
100-
return dld_strerror(dld_errno);
101-
}

src/backend/port/dynloader/dgux.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
/*-------------------------------------------------------------------------
22
*
3-
* port-protos.h--
4-
* port-specific prototypes for SunOS 4
5-
*
6-
*
3+
* dgux.h--
4+
*
75
* Copyright (c) 1994, Regents of the University of California
86
*
9-
* $Id: dgux.h,v 1.1 1997/12/20 04:48:04 scrappy Exp $
7+
* $Id: dgux.h,v 1.2 1998/02/14 19:56:21 scrappy Exp $
108
*
119
*-------------------------------------------------------------------------
1210
*/
1311
#ifndef PORT_PROTOS_H
1412
#define PORT_PROTOS_H
1513

14+
#include <dlfcn.h>
1615
#include "fmgr.h" /* for func_ptr */
1716
#include "utils/dynamic_loader.h"
18-
#include "dlfcn.h"
1917

20-
/* dynloader.c */
21-
22-
/* #define pg_dlopen(f) dlopen(f, 1) */
23-
#define pg_dlopen(f) dlopen(f, 2)
18+
/*
19+
* Dynamic Loader on DG/UX.
20+
*
21+
* this dynamic loader uses the system dynamic loading interface for shared
22+
* libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared
23+
* library as the file to be dynamically loaded.
24+
*
25+
*/
26+
#define pg_dlopen(f) dlopen(f,1)
2427
#define pg_dlsym dlsym
2528
#define pg_dlclose dlclose
2629
#define pg_dlerror dlerror
2730

28-
/* port.c */
29-
3031
#endif /* PORT_PROTOS_H */

src/include/config.h.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
/* Set to 1 if you have <fp_class.h> */
1818
#undef HAVE_FP_CLASS_H
1919

20+
/* Set to 1 if you have <netinet/in.h> */
21+
#undef HAVE_NETINET_IN_H
22+
2023
/* Set to 1 if you have <ieeefp.h> */
2124
#undef HAVE_IEEEFP_H
2225

@@ -96,6 +99,9 @@ int gethostname(char *name, int namelen);
9699
#undef HAVE_INET_ATON
97100
#ifndef HAVE_INET_ATON
98101
# ifdef HAVE_ARPA_INET_H
102+
# ifdef HAVE_NETINET_IN_H
103+
# include <netinet/in.h>
104+
# endif
99105
# include <arpa/inet.h>
100106
# endif
101107
extern int inet_aton(const char *cp, struct in_addr * addr);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy