More cleanups...several ports are major redundancies of other ports

This commit is contained in:
Marc G. Fournier 1997-12-19 02:46:25 +00:00
parent 3ad815fc2a
commit 3aae0f5300
12 changed files with 19 additions and 377 deletions

View File

@ -19,14 +19,15 @@
# be converted to Method 2.
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/port/Attic/Makefile.in,v 1.5 1997/12/19 02:06:24 scrappy Exp $
# $Header: /cvsroot/pgsql/src/backend/port/Attic/Makefile.in,v 1.6 1997/12/19 02:45:38 scrappy Exp $
#
#-------------------------------------------------------------------------
SRCDIR=../..
include ../../Makefile.global
OBJS = @PORTNAME@/SUBSYS.o @INET_ATON@ @STRERROR@
OBJS = @PORTNAME@/SUBSYS.o @INET_ATON@ @STRERROR@ @RANDOM@ @SRANDOM@
OBJS+= @GETHOSTNAME@ @GETRUSAGE@ @STRCASECMP@
all: submake SUBSYS.o

View File

@ -4,6 +4,11 @@
#include "rusagestub.h"
#include "port-protos.h"
#ifdef 0 /* this is from univel port ... how does compiler define? */
/* same for i386_solaris port ... how does compiler define? */
/* same for sco port ... how does compiler define? */
/* same for sparc_solaris port ... how does compiler define? */
/* same for svr4 port ... how does compiler define? */
int
getrusage(int who, struct rusage * rusage)
{
@ -44,4 +49,11 @@ getrusage(int who, struct rusage * rusage)
rusage->ru_stime.tv_usec = TICK_TO_USEC(u, tick_rate);
return (0);
}
#endif
#ifdef 0 /* this is for hpux port ... how does compiler define? */
getrusage(int who, struct rusage * ru)
{
return (syscall(SYS_GETRUSAGE, who, ru));
}
#endif

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/port/hpux/Attic/port.c,v 1.3 1997/09/07 04:45:52 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/port/hpux/Attic/port.c,v 1.4 1997/12/19 02:45:44 scrappy Exp $
*
* NOTES
* For the most part, this file gets around some non-POSIX calls
@ -30,20 +30,3 @@ init_address_fixup()
* by the kernel.
*/
}
long
random()
{
return (lrand48());
}
void
srandom(unsigned seed)
{
srand48((long int) seed);
}
getrusage(int who, struct rusage * ru)
{
return (syscall(SYS_GETRUSAGE, who, ru));
}

View File

@ -1,70 +0,0 @@
/*-------------------------------------------------------------------------
*
* port.c--
* SunOS5-specific routines
*
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/port/i386_solaris/Attic/port.c,v 1.3 1997/09/08 02:26:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <math.h> /* for pow() prototype */
#include <errno.h>
#include "rusagestub.h"
long
random()
{
return (lrand48());
}
void
srandom(int seed)
{
srand48((long int) seed);
}
int
getrusage(int who, struct rusage * rusage)
{
struct tms tms;
register int tick_rate = CLK_TCK; /* ticks per second */
clock_t u,
s;
if (rusage == (struct rusage *) NULL)
{
errno = EFAULT;
return (-1);
}
if (times(&tms) < 0)
{
/* errno set by times */
return (-1);
}
switch (who)
{
case RUSAGE_SELF:
u = tms.tms_utime;
s = tms.tms_stime;
break;
case RUSAGE_CHILDREN:
u = tms.tms_cutime;
s = tms.tms_cstime;
break;
default:
errno = EINVAL;
return (-1);
}
#define TICK_TO_SEC(T, RATE) ((T)/(RATE))
#define TICK_TO_USEC(T,RATE) (((T)%(RATE)*1000000)/RATE)
rusage->ru_utime.tv_sec = TICK_TO_SEC(u, tick_rate);
rusage->ru_utime.tv_usec = TICK_TO_USEC(u, tick_rate);
rusage->ru_stime.tv_sec = TICK_TO_SEC(s, tick_rate);
rusage->ru_stime.tv_usec = TICK_TO_USEC(u, tick_rate);
return (0);
}

View File

@ -1,35 +0,0 @@
#-------------------------------------------------------------------------
#
# Makefile--
# Makefile for port/sco
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/port/sco/Attic/Makefile,v 1.1 1997/07/28 01:33:54 momjian Exp $
#
#-------------------------------------------------------------------------
SRCDIR = ../../..
include ../../../Makefile.global
INCLUDE_OPT = -I../.. \
-I../../../include
CFLAGS+=$(INCLUDE_OPT)
OBJS = port.o
all: SUBSYS.o
SUBSYS.o: $(OBJS)
$(LD) -r -o SUBSYS.o $(OBJS)
depend dep:
$(CC) -MM $(INCLUDE_OPT) *.c >depend
clean:
rm -f SUBSYS.o $(OBJS)
ifeq (depend,$(wildcard depend))
include depend
endif

View File

@ -1,60 +0,0 @@
/*-------------------------------------------------------------------------
*
* port.c--
* SCO 3.2v5.0.2 specific routines
*
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* /usr/local/devel/pglite/cvs/src/backend/port/svr4/port.c,v 1.2 1995/03/17 06:40:19 andrew Exp
*
*-------------------------------------------------------------------------
*/
#include <unistd.h>
#include <math.h> /* for pow() prototype */
#include <errno.h>
#include "rusagestub.h"
int
getrusage(int who, struct rusage * rusage)
{
struct tms tms;
register int tick_rate = CLK_TCK; /* ticks per second */
clock_t u,
s;
if (rusage == (struct rusage *) NULL)
{
errno = EFAULT;
return (-1);
}
if (times(&tms) < 0)
{
/* errno set by times */
return (-1);
}
switch (who)
{
case RUSAGE_SELF:
u = tms.tms_utime;
s = tms.tms_stime;
break;
case RUSAGE_CHILDREN:
u = tms.tms_cutime;
s = tms.tms_cstime;
break;
default:
errno = EINVAL;
return (-1);
}
#define TICK_TO_SEC(T, RATE) ((T)/(RATE))
#define TICK_TO_USEC(T,RATE) (((T)%(RATE)*1000000)/RATE)
rusage->ru_utime.tv_sec = TICK_TO_SEC(u, tick_rate);
rusage->ru_utime.tv_usec = TICK_TO_USEC(u, tick_rate);
rusage->ru_stime.tv_sec = TICK_TO_SEC(s, tick_rate);
rusage->ru_stime.tv_usec = TICK_TO_USEC(u, tick_rate);
return (0);
}

View File

@ -4,7 +4,7 @@
# Makefile for port/sparc_solaris
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/port/sparc_solaris/Attic/Makefile,v 1.3 1996/11/10 00:38:38 bryanh Exp $
# $Header: /cvsroot/pgsql/src/backend/port/sparc_solaris/Attic/Makefile,v 1.4 1997/12/19 02:46:16 scrappy Exp $
#
#-------------------------------------------------------------------------
@ -17,7 +17,7 @@ INCLUDE_OPT = -I.. \
CFLAGS+=$(INCLUDE_OPT)
OBJS = port.o tas.o
OBJS = tas.o
all: SUBSYS.o

View File

@ -1,83 +0,0 @@
/*-------------------------------------------------------------------------
*
* port.c--
* SunOS5-specific routines
*
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/port/sparc_solaris/Attic/port.c,v 1.7 1997/09/18 16:09:15 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#include <math.h> /* for pow() prototype */
#include <stdlib.h>
#include <errno.h>
#include "postgres.h"
#include "port-protos.h"
#ifndef HAVE_GETRUSAGE
#include "rusagestub.h"
#endif /* HAVE_GETRUSAGE */
#ifndef HAVE_RANDOM
long
random()
{
return (lrand48());
}
#endif
#ifndef HAVE_RANDOM
void
srandom(int seed)
{
srand48((long int) seed);
}
#endif
#ifndef HAVE_GETRUSAGE
int
getrusage(int who, struct rusage * rusage)
{
struct tms tms;
register int tick_rate = CLK_TCK; /* ticks per second */
clock_t u,
s;
if (rusage == (struct rusage *) NULL)
{
errno = EFAULT;
return (-1);
}
if (times(&tms) < 0)
{
/* errno set by times */
return (-1);
}
switch (who)
{
case RUSAGE_SELF:
u = tms.tms_utime;
s = tms.tms_stime;
break;
case RUSAGE_CHILDREN:
u = tms.tms_cutime;
s = tms.tms_cstime;
break;
default:
errno = EINVAL;
return (-1);
}
#define TICK_TO_SEC(T, RATE) ((T)/(RATE))
#define TICK_TO_USEC(T,RATE) (((T)%(RATE)*1000000)/RATE)
rusage->ru_utime.tv_sec = TICK_TO_SEC(u, tick_rate);
rusage->ru_utime.tv_usec = TICK_TO_USEC(u, tick_rate);
rusage->ru_stime.tv_sec = TICK_TO_SEC(s, tick_rate);
rusage->ru_stime.tv_usec = TICK_TO_USEC(u, tick_rate);
return (0);
}
#endif /* HAVE_GETRUSAGE */

View File

@ -5,7 +5,7 @@
#include "port-protos.h"
void
srandom(int seed)
srandom(unsigned int seed)
{
srand48((long int) seed);
}

View File

@ -1,74 +1,3 @@
/*-------------------------------------------------------------------------
*
* port.c--
* Intel x86/Intel SVR4-specific routines
*
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* /usr/local/devel/pglite/cvs/src/backend/port/svr4/port.c,v 1.2 1995/03/17 06:40:19 andrew Exp
*
*-------------------------------------------------------------------------
*/
#include <math.h> /* for pow() prototype */
#include <errno.h>
#include "rusagestub.h"
long
random()
{
return (lrand48());
}
void
srandom(int seed)
{
srand48((long int) seed);
}
int
getrusage(int who, struct rusage * rusage)
{
struct tms tms;
register int tick_rate = CLK_TCK; /* ticks per second */
clock_t u,
s;
if (rusage == (struct rusage *) NULL)
{
errno = EFAULT;
return (-1);
}
if (times(&tms) < 0)
{
/* errno set by times */
return (-1);
}
switch (who)
{
case RUSAGE_SELF:
u = tms.tms_utime;
s = tms.tms_stime;
break;
case RUSAGE_CHILDREN:
u = tms.tms_cutime;
s = tms.tms_cstime;
break;
default:
errno = EINVAL;
return (-1);
}
#define TICK_TO_SEC(T, RATE) ((T)/(RATE))
#define TICK_TO_USEC(T,RATE) (((T)%(RATE)*1000000)/RATE)
rusage->ru_utime.tv_sec = TICK_TO_SEC(u, tick_rate);
rusage->ru_utime.tv_usec = TICK_TO_USEC(u, tick_rate);
rusage->ru_stime.tv_sec = TICK_TO_SEC(s, tick_rate);
rusage->ru_stime.tv_usec = TICK_TO_USEC(u, tick_rate);
return (0);
}
/*
* Copyright (c) 1987 Regents of the University of California.
* All rights reserved.

View File

@ -1,35 +0,0 @@
#-------------------------------------------------------------------------
#
# Makefile--
# Makefile for port/svr4
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/port/svr4/Attic/Makefile,v 1.2 1996/11/09 06:20:26 momjian Exp $
#
#-------------------------------------------------------------------------
SRCDIR = ../../..
include ../../../Makefile.global
INCLUDE_OPT = -I../.. \
-I../../../include
CFLAGS+=$(INCLUDE_OPT)
OBJS = port.o
all: SUBSYS.o
SUBSYS.o: $(OBJS)
$(LD) -r -o SUBSYS.o $(OBJS)
depend dep:
$(CC) -MM $(INCLUDE_OPT) *.c >depend
clean:
rm -f SUBSYS.o $(OBJS)
ifeq (depend,$(wildcard depend))
include depend
endif