1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Remove dead ports

Remove the following ports:

- dgux
- nextstep
- sunos4
- svr4
- ultrix4
- univel

These are obsolete and not worth rescuing.  In most cases, there is
circumstantial evidence that they wouldn't work anymore anyway.
This commit is contained in:
Peter Eisentraut
2012-05-01 22:11:12 +03:00
parent 4266509c57
commit f2f9439fbf
39 changed files with 5 additions and 798 deletions

View File

@ -1,6 +0,0 @@
/* Dummy file used for nothing at this point
*
* see dgux.h
*
* src/backend/port/dynloader/dgux.c
*/

View File

@ -1,44 +0,0 @@
/*-------------------------------------------------------------------------
*
* dgux.h
*
* Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/backend/port/dynloader/dgux.h
*
*-------------------------------------------------------------------------
*/
#ifndef PORT_PROTOS_H
#define PORT_PROTOS_H
#include <dlfcn.h>
#include "utils/dynamic_loader.h" /* pgrminclude ignore */
/*
* Dynamic Loader on DG/UX.
*
* this dynamic loader uses the system dynamic loading interface for shared
* libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared
* library as the file to be dynamically loaded.
*/
/*
* In some older systems, the RTLD_NOW flag isn't defined and the mode
* argument to dlopen must always be 1. The RTLD_GLOBAL flag is wanted
* if available, but it doesn't exist everywhere.
* If it doesn't exist, set it to 0 so it has no effect.
*/
#ifndef RTLD_NOW
#define RTLD_NOW 1
#endif
#ifndef RTLD_GLOBAL
#define RTLD_GLOBAL 0
#endif
#define pg_dlopen(f) dlopen((f), RTLD_NOW | RTLD_GLOBAL)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
#endif /* PORT_PROTOS_H */

View File

@ -18,7 +18,7 @@
#include "utils/dynamic_loader.h" /* pgrminclude ignore */
/*
* Dynamic Loader on SunOS 4.
* Dynamic Loader on Irix.
*
* this dynamic loader uses the system dynamic loading interface for shared
* libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared

View File

@ -1,84 +0,0 @@
/* src/backend/port/dynloader/nextstep.c */
#include "postgres.h"
#include "mach-o/rld.h"
#include "streams/streams.h"
static char *lastError = NULL;
static NXStream *
OpenError()
{
return NXOpenMemory(NULL, 0, NX_WRITEONLY);
}
static void
CloseError(NXStream * s)
{
if (s)
NXCloseMemory(s, NX_FREEBUFFER);
}
static void
TransferError(NXStream * s)
{
char *buffer;
int len,
maxlen;
if (lastError)
free(lastError);
NXGetMemoryBuffer(s, &buffer, &len, &maxlen);
lastError = malloc(len + 1);
strcpy(lastError, buffer);
}
void *
next_dlopen(char *name)
{
int rld_success;
NXStream *errorStream;
char *result = NULL;
char **p;
errorStream = OpenError();
p = calloc(2, sizeof(void *));
p[0] = name;
rld_success = rld_load(errorStream, NULL, p, NULL);
free(p);
if (!rld_success)
{
TransferError(errorStream);
result = (char *) 1;
}
CloseError(errorStream);
return result;
}
int
next_dlclose(void *handle)
{
return 0;
}
void *
next_dlsym(void *handle, char *symbol)
{
NXStream *errorStream = OpenError();
char symbuf[1024];
unsigned long symref = 0;
snprintf(symbuf, sizeof(symbuf), "_%s", symbol);
if (!rld_lookup(errorStream, symbuf, &symref))
TransferError(errorStream);
CloseError(errorStream);
return (void *) symref;
}
char *
next_dlerror(void)
{
return lastError;
}

View File

@ -1,26 +0,0 @@
/*-------------------------------------------------------------------------
*
* port_protos.h
* port-specific prototypes for NeXT
*
* src/backend/port/dynloader/nextstep.h
*/
#ifndef PORT_PROTOS_H
#define PORT_PROTOS_H
#include "utils/dynamic_loader.h" /* pgrminclude ignore */
void *next_dlopen(char *name);
int next_dlclose(void *handle);
void *next_dlsym(void *handle, char *symbol);
char *next_dlerror(void);
#define pg_dlopen(f) next_dlopen
#define pg_dlsym next_dlsym
#define pg_dlclose next_dlclose
#define pg_dlerror next_dlerror
/* port.c */
#endif /* PORT_PROTOS_H */

View File

@ -1,7 +0,0 @@
/*
* src/backend/port/dynloader/sunos4.c
*
* Dummy file used for nothing at this point
*
* see sunos4.h
*/

View File

@ -1,46 +0,0 @@
/*-------------------------------------------------------------------------
*
* sunos4.h
* port-specific prototypes for SunOS 4
*
*
* Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/backend/port/dynloader/sunos4.h
*
*-------------------------------------------------------------------------
*/
#ifndef PORT_PROTOS_H
#define PORT_PROTOS_H
#include <dlfcn.h>
#include "utils/dynamic_loader.h" /* pgrminclude ignore */
/*
* Dynamic Loader on SunOS 4.
*
* this dynamic loader uses the system dynamic loading interface for shared
* libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared
* library as the file to be dynamically loaded.
*/
/*
* In some older systems, the RTLD_NOW flag isn't defined and the mode
* argument to dlopen must always be 1. The RTLD_GLOBAL flag is wanted
* if available, but it doesn't exist everywhere.
* If it doesn't exist, set it to 0 so it has no effect.
*/
#ifndef RTLD_NOW
#define RTLD_NOW 1
#endif
#ifndef RTLD_GLOBAL
#define RTLD_GLOBAL 0
#endif
#define pg_dlopen(f) dlopen((f), RTLD_NOW | RTLD_GLOBAL)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
#endif /* PORT_PROTOS_H */

View File

@ -1,7 +0,0 @@
/*
* src/backend/port/dynloader/svr4.c
*
* Dummy file used for nothing at this point
*
* see svr4.h
*/

View File

@ -1,46 +0,0 @@
/*-------------------------------------------------------------------------
*
* svr4.h
* port-specific prototypes for Intel x86/Intel SVR4
*
*
* Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/backend/port/dynloader/svr4.h
*
*-------------------------------------------------------------------------
*/
#ifndef PORT_PROTOS_H
#define PORT_PROTOS_H
#include <dlfcn.h>
#include "utils/dynamic_loader.h" /* pgrminclude ignore */
/*
* Dynamic Loader on Intel x86/Intel SVR4.
*
* this dynamic loader uses the system dynamic loading interface for shared
* libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared
* library as the file to be dynamically loaded.
*/
/*
* In some older systems, the RTLD_NOW flag isn't defined and the mode
* argument to dlopen must always be 1. The RTLD_GLOBAL flag is wanted
* if available, but it doesn't exist everywhere.
* If it doesn't exist, set it to 0 so it has no effect.
*/
#ifndef RTLD_NOW
#define RTLD_NOW 1
#endif
#ifndef RTLD_GLOBAL
#define RTLD_GLOBAL 0
#endif
#define pg_dlopen(f) dlopen((f), RTLD_NOW | RTLD_GLOBAL)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
#endif /* PORT_PROTOS_H */

View File

@ -1,67 +0,0 @@
/*-------------------------------------------------------------------------
*
* ultrix4.c
* This dynamic loader uses Andrew Yu's libdl-1.0 package for Ultrix 4.x.
*
* Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* src/backend/port/dynloader/ultrix4.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "dl.h"
#include "utils/dynamic_loader.h"
extern char my_exec_path[];
void *
pg_dlopen(char *filename)
{
static int dl_initialized = 0;
void *handle;
/*
* initializes the dynamic loader with the executable's pathname. (only
* needs to do this the first time pg_dlopen is called.)
*/
if (!dl_initialized)
{
if (!dl_init(my_exec_path))
return NULL;
/*
* if there are undefined symbols, we want dl to search from the
* following libraries also.
*/
dl_setLibraries("/usr/lib/libm_G0.a:/usr/lib/libc_G0.a");
dl_initialized = 1;
}
/*
* open the file. We do the symbol resolution right away so that we will
* know if there are undefined symbols. (This is in fact the same
* semantics as "ld -A". ie. you cannot have undefined symbols.
*/
if ((handle = dl_open(filename, DL_NOW)) == NULL)
{
int count;
char **list = dl_undefinedSymbols(&count);
/* list the undefined symbols, if any */
if (count)
{
while (*list)
{
elog(WARNING, "\"%s\" is undefined", *list);
list++;
}
}
}
return (void *) handle;
}

View File

@ -1,109 +0,0 @@
/*-------------------------------------------------------------------------
*
* dl.h
*
*
*
* Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/backend/port/dynloader/ultrix4.h
*
*-------------------------------------------------------------------------
*/
/*
* Ultrix 4.x Dynamic Loader Library Version 1.0
*
* dl.h
* header file for the Dynamic Loader Library
*/
#ifndef _DL_HEADER_
#define _DL_HEADER_
#include <stdio.h>
#include "filehdr.h"
#include "syms.h"
#include "ldfcn.h"
#include "reloc.h"
#include "scnhdr.h"
typedef long CoreAddr;
typedef struct ScnInfo
{
CoreAddr addr; /* starting address of the section */
SCNHDR hdr; /* section header */
RELOC *relocEntries; /* relocation entries */
} ScnInfo;
typedef enum
{
DL_NEEDRELOC, /* still need relocation */
DL_RELOCATED, /* no relocation necessary */
DL_INPROG /* relocation in progress */
} dlRStatus;
typedef struct JmpTbl
{
char *block; /* the jump table memory block */
struct JmpTbl *next; /* next block */
} JmpTbl;
typedef struct dlFile
{
char *filename; /* file name of the object file */
int textSize; /* used by mprotect */
CoreAddr textAddress; /* start addr of text section */
long textVaddr; /* vaddr of text section in obj file */
CoreAddr rdataAddress; /* start addr of rdata section */
long rdataVaddr; /* vaddr of text section in obj file */
CoreAddr dataAddress; /* start addr of data section */
long dataVaddr; /* vaddr of text section in obj file */
CoreAddr bssAddress; /* start addr of bss section */
long bssVaddr; /* vaddr of text section in obj file */
int nsect; /* number of sections */
ScnInfo *sect; /* details of each section (array) */
int issExtMax; /* size of string space */
char *extss; /* extern sym string space (in core) */
int iextMax; /* maximum number of Symbols */
pEXTR extsyms; /* extern syms */
dlRStatus relocStatus; /* what relocation needed? */
int needReloc;
JmpTbl *jmptable; /* the jump table for R_JMPADDR */
struct dlFile *next; /* next member of the archive */
} dlFile;
typedef struct dlSymbol
{
char *name; /* name of the symbol */
long addr; /* address of the symbol */
dlFile *objFile; /* from which file */
} dlSymbol;
/*
* prototypes for the dl* interface
*/
extern void *dl_open( /* char *filename, int mode */ );
extern void *dl_sym( /* void *handle, char *name */ );
extern void dl_close( /* void *handle */ );
extern char *dl_error( /* void */ );
#define DL_LAZY 0 /* lazy resolution */
#define DL_NOW 1 /* immediate resolution */
/*
* Miscellaneous utility routines:
*/
extern char **dl_undefinedSymbols( /* int *count */ );
extern void dl_printAllSymbols( /* void *handle */ );
extern void dl_setLibraries( /* char *libs */ );
#endif /* _DL_HEADER_ */

View File

@ -1,7 +0,0 @@
/*
* src/backend/port/dynloader/univel.c
*
* Dummy file used for nothing at this point
*
* see univel.h
*/

View File

@ -1,49 +0,0 @@
/*
* src/backend/port/dynloader/univel.h
*
*-------------------------------------------------------------------------
*
* univel.h
* port-specific prototypes for Intel x86/UNIXWARE
*
*
* Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* univel.h,v 1.2 1995/03/17 06:40:18 andrew Exp
*
*-------------------------------------------------------------------------
*/
#ifndef PORT_PROTOS_H
#define PORT_PROTOS_H
#include <dlfcn.h>
#include "utils/dynamic_loader.h" /* pgrminclude ignore */
/*
* Dynamic Loader on Intel x86/Intel SVR4.
*
* this dynamic loader uses the system dynamic loading interface for shared
* libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared
* library as the file to be dynamically loaded.
*/
/*
* In some older systems, the RTLD_NOW flag isn't defined and the mode
* argument to dlopen must always be 1. The RTLD_GLOBAL flag is wanted
* if available, but it doesn't exist everywhere.
* If it doesn't exist, set it to 0 so it has no effect.
*/
#ifndef RTLD_NOW
#define RTLD_NOW 1
#endif
#ifndef RTLD_GLOBAL
#define RTLD_GLOBAL 0
#endif
#define pg_dlopen(f) dlopen((f), RTLD_NOW | RTLD_GLOBAL)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
#endif /* PORT_PROTOS_H */

View File

@ -21,7 +21,7 @@
#include "utils/dynamic_loader.h" /* pgrminclude ignore */
/*
* Dynamic Loader on Intel x86/Intel SVR4.
* Dynamic Loader on UnixWare.
*
* this dynamic loader uses the system dynamic loading interface for shared
* libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared

View File

@ -1,17 +0,0 @@
#-------------------------------------------------------------------------
#
# Makefile--
# Makefile for port/nextstep
#
# IDENTIFICATION
# src/backend/port/nextstep/Makefile
#
#-------------------------------------------------------------------------
subdir = src/backend/port/nextstep
top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
OBJS = port.o
include $(top_srcdir)/src/backend/common.mk

View File

@ -1,62 +0,0 @@
/*
* src/backend/port/nextstep/port.c
*/
#include "postgres.h"
#ifndef _POSIX_SOURCE
#include "libc.h"
#else
#include <unistd.h>
#endif
#include <sys/signal.h>
void
putenv(char *name)
{
extern char **environ;
static int was_mallocated = 0;
int size;
/* Compute the size of environ array including the final NULL */
for (size = 1; environ[size++];)
/* nothing */ ;
if (!was_mallocated)
{
char **tmp = environ;
int i;
was_mallocated = 1;
environ = malloc(size * sizeof(char *));
for (i = 0; i < size; i++)
environ[i] = tmp[i];
}
environ = realloc(environ, (size + 1) * sizeof(char *));
environ[size - 1] = strcpy(malloc(strlen(name) + 1), name);
environ[size] = NULL;
}
#ifndef _POSIX_SOURCE
int
sigaddset(int *set, int signo)
{
*set |= sigmask(signo);
return *set;
}
int
sigemptyset(int *set)
{
return *set = 0;
}
char *
getcwd(char *buf, size_t size)
{
return getwd(buf);
}
#endif