Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8338f90

Browse files
committed
Add SCO files.
1 parent79e78f0 commit8338f90

File tree

7 files changed

+180
-0
lines changed

7 files changed

+180
-0
lines changed

‎src/backend/port/sco/Makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#-------------------------------------------------------------------------
2+
#
3+
# Makefile--
4+
# Makefile for port/sco
5+
#
6+
# IDENTIFICATION
7+
# $Header: /cvsroot/pgsql/src/backend/port/sco/Attic/Makefile,v 1.1 1997/07/28 01:33:54 momjian Exp $
8+
#
9+
#-------------------------------------------------------------------------
10+
11+
SRCDIR = ../../..
12+
include ../../../Makefile.global
13+
14+
INCLUDE_OPT = -I../..\
15+
-I../../../include
16+
17+
CFLAGS+=$(INCLUDE_OPT)
18+
19+
OBJS = port.o
20+
21+
all: SUBSYS.o
22+
23+
SUBSYS.o:$(OBJS)
24+
$(LD) -r -o SUBSYS.o$(OBJS)
25+
26+
dependdep:
27+
$(CC) -MM$(INCLUDE_OPT)*.c>depend
28+
29+
clean:
30+
rm -f SUBSYS.o$(OBJS)
31+
32+
ifeq (depend,$(wildcard depend))
33+
include depend
34+
endif
35+

‎src/backend/port/sco/port-protos.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* port-protos.h--
4+
* port-specific prototypes for SCO 3.2v5.2
5+
*
6+
*
7+
* Copyright (c) 1994, Regents of the University of California
8+
*
9+
* $Id: port-protos.h,v 1.1 1997/07/28 01:33:55 momjian Exp $
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
#ifndefPORT_PROTOS_H
14+
#definePORT_PROTOS_H
15+
16+
#include<dlfcn.h>
17+
#include"fmgr.h"/* for func_ptr */
18+
#include"utils/dynamic_loader.h"
19+
20+
/* dynloader.c */
21+
/*
22+
* Dynamic Loader on SCO 3.2v5.0.2
23+
*
24+
* this dynamic loader uses the system dynamic loading interface for shared
25+
* libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared
26+
* library as the file to be dynamically loaded.
27+
*
28+
*/
29+
#definepg_dlopen(f)dlopen(f,1)
30+
#definepg_dlsymdlsym
31+
#definepg_dlclosedlclose
32+
#definepg_dlerrordlerror
33+
34+
/* port.c */
35+
36+
#endif/* PORT_PROTOS_H */

‎src/backend/port/sco/port.c

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* port.c--
4+
* SCO 3.2v5.0.2 specific routines
5+
*
6+
* Copyright (c) 1994, Regents of the University of California
7+
*
8+
*
9+
* IDENTIFICATION
10+
* /usr/local/devel/pglite/cvs/src/backend/port/svr4/port.c,v 1.2 1995/03/17 06:40:19 andrew Exp
11+
*
12+
*-------------------------------------------------------------------------
13+
*/
14+
#include<unistd.h>
15+
#include<math.h>/* for pow() prototype */
16+
17+
#include<errno.h>
18+
#include"rusagestub.h"
19+
20+
21+
int
22+
getrusage(intwho,structrusage*rusage)
23+
{
24+
structtmstms;
25+
registerinttick_rate=CLK_TCK;/* ticks per second */
26+
clock_tu,s;
27+
28+
if (rusage== (structrusage*)NULL) {
29+
errno=EFAULT;
30+
return(-1);
31+
}
32+
if (times(&tms)<0) {
33+
/* errno set by times */
34+
return(-1);
35+
}
36+
switch (who) {
37+
caseRUSAGE_SELF:
38+
u=tms.tms_utime;
39+
s=tms.tms_stime;
40+
break;
41+
caseRUSAGE_CHILDREN:
42+
u=tms.tms_cutime;
43+
s=tms.tms_cstime;
44+
break;
45+
default:
46+
errno=EINVAL;
47+
return(-1);
48+
}
49+
#defineTICK_TO_SEC(T,RATE)((T)/(RATE))
50+
#defineTICK_TO_USEC(T,RATE)(((T)%(RATE)*1000000)/RATE)
51+
rusage->ru_utime.tv_sec=TICK_TO_SEC(u,tick_rate);
52+
rusage->ru_utime.tv_usec=TICK_TO_USEC(u,tick_rate);
53+
rusage->ru_stime.tv_sec=TICK_TO_SEC(s,tick_rate);
54+
rusage->ru_stime.tv_usec=TICK_TO_USEC(u,tick_rate);
55+
return(0);
56+
}
57+

‎src/backend/port/sco/rusagestub.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* rusagestub.h--
4+
* Stubs for getrusage(3).
5+
*
6+
*
7+
* Copyright (c) 1994, Regents of the University of California
8+
*
9+
* rusagestub.h,v 1.1.1.1 1994/11/07 05:19:39 andrew Exp
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
#ifndefRUSAGESTUB_H
14+
#defineRUSAGESTUB_H
15+
16+
#include<sys/time.h>/* for struct timeval */
17+
#include<sys/times.h>/* for struct tms */
18+
#include<limits.h>/* for CLK_TCK */
19+
20+
#defineRUSAGE_SELF0
21+
#defineRUSAGE_CHILDREN-1
22+
23+
structrusage {
24+
structtimevalru_utime;/* user time used */
25+
structtimevalru_stime;/* system time used */
26+
};
27+
28+
externintgetrusage(intwho,structrusage*rusage);
29+
30+
#endif/* RUSAGESTUB_H */

‎src/include/port/sco.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include<limits.h>/* For _POSIX_PATH_MAX */
2+
3+
#defineMAXPATHLEN_POSIX_PATH_MAX
4+
#defineSIGURGSIGUSR1
5+
6+
#defineNOFILENOFILES_MIN

‎src/makefiles/Makefile.sco

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
%.so:%.o
2+
$(LD)-G-Bdynamic -o $@ $<
3+
%.so:%.o
4+
$(LD)-G-Bdynamic -o $@ $<

‎src/template/sco

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
AROPT:cq
2+
CFLAGS:-I$(SRCDIR)/backend/port/sco
3+
SHARED_LIB:-K PIC
4+
ALL:
5+
SRCH_INC:
6+
SRCH_LIB:
7+
USE_LOCALE:no
8+
DLSUFFIX:.so
9+
YFLAGS:-d
10+
YACC:yacc
11+
LEX:lex
12+
CC:cc -b elf

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp