File tree Expand file tree Collapse file tree 12 files changed +245
-13
lines changed Expand file tree Collapse file tree 12 files changed +245
-13
lines changed Original file line number Diff line number Diff line change 7
7
#
8
8
#
9
9
# IDENTIFICATION
10
- # $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.7 1996/07/20 07:57:49 scrappy Exp $
10
+ # $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.8 1996/07/20 08:34:08 scrappy Exp $
11
11
#
12
12
# NOTES
13
13
# This is seen by any Makefiles that include mk/postgres.mk. To
35
35
# The name of the port. Valid choices are:
36
36
# alpha - DEC Alpha AXP on OSF/1 2.0
37
37
# hpux - HP PA-RISC on HP-UX 9.0
38
+ # i386_solaris - i386 Solaris
38
39
# sparc_solaris - SUN SPARC on Solaris 2.4
39
40
# sparc - SUN SPARC on SunOS 4.1.3
40
41
# ultrix4 - DEC MIPS on Ultrix 4.4
Original file line number Diff line number Diff line change
1
+ # -------------------------------------------------------------------------
2
+ #
3
+ # Makefile.inc--
4
+ # Makefile for port/sparc_solaris (SPARC/Solaris 2.x specific stuff)
5
+ #
6
+ # Copyright (c) 1994, Regents of the University of California
7
+ #
8
+ #
9
+ # IDENTIFICATION
10
+ # $Header: /cvsroot/pgsql/src/backend/port/i386_solaris/Attic/Makefile.inc,v 1.1 1996/07/20 08:34:32 scrappy Exp $
11
+ #
12
+ # -------------------------------------------------------------------------
13
+
14
+ CFLAGS+ = -DUSE_POSIX_TIME -DNEED_ISINF -DNEED_RUSAGE -DNO_EMPTY_STMTS
15
+
16
+ LDADD+ = -ll -ldl
17
+
18
+ SUBSRCS+ = port.c
19
+
20
+ HEADERS+ = machine.h port-protos.h rusagestub.h
Original file line number Diff line number Diff line change
1
+ /*-------------------------------------------------------------------------
2
+ *
3
+ * machine.h--
4
+ *
5
+ *
6
+ *
7
+ * Copyright (c) 1994, Regents of the University of California
8
+ *
9
+ * $Id: machine.h,v 1.1 1996/07/20 08:34:33 scrappy Exp $
10
+ *
11
+ *-------------------------------------------------------------------------
12
+ */
13
+ #ifndef MACHINE_H
14
+ #define MACHINE_H
15
+
16
+ #define BLCKSZ 8192
17
+
18
+ #endif
19
+
Original file line number Diff line number Diff line change
1
+ /*-------------------------------------------------------------------------
2
+ *
3
+ * port-protos.h--
4
+ * port-specific prototypes for SunOS 4
5
+ *
6
+ *
7
+ * Copyright (c) 1994, Regents of the University of California
8
+ *
9
+ * $Id: port-protos.h,v 1.1 1996/07/20 08:34:33 scrappy Exp $
10
+ *
11
+ *-------------------------------------------------------------------------
12
+ */
13
+ #ifndef PORT_PROTOS_H
14
+ #define PORT_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 SunOS 4.
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
+ #define pg_dlopen (f ) dlopen(f,1)
30
+ #define pg_dlsym dlsym
31
+ #define pg_dlclose dlclose
32
+ #define pg_dlerror dlerror
33
+
34
+ /* port.c */
35
+ extern long random (void );
36
+ extern void srandom (int seed );
37
+
38
+ #endif /* PORT_PROTOS_H */
Original file line number Diff line number Diff line change
1
+ /*-------------------------------------------------------------------------
2
+ *
3
+ * port.c--
4
+ * SunOS5-specific routines
5
+ *
6
+ * Copyright (c) 1994, Regents of the University of California
7
+ *
8
+ *
9
+ * IDENTIFICATION
10
+ * $Header: /cvsroot/pgsql/src/backend/port/i386_solaris/Attic/port.c,v 1.1 1996/07/20 08:34:34 scrappy Exp $
11
+ *
12
+ *-------------------------------------------------------------------------
13
+ */
14
+ #include <math.h> /* for pow() prototype */
15
+
16
+ #include <errno.h>
17
+ #include "rusagestub.h"
18
+
19
+ long
20
+ random ()
21
+ {
22
+ return (lrand48 ());
23
+ }
24
+
25
+ void
26
+ srandom (int seed )
27
+ {
28
+ srand48 ((long int ) seed );
29
+ }
30
+
31
+ int
32
+ getrusage (int who , struct rusage * rusage )
33
+ {
34
+ struct tms tms ;
35
+ register int tick_rate = CLK_TCK ; /* ticks per second */
36
+ clock_t u , s ;
37
+
38
+ if (rusage == (struct rusage * ) NULL ) {
39
+ errno = EFAULT ;
40
+ return (-1 );
41
+ }
42
+ if (times (& tms ) < 0 ) {
43
+ /* errno set by times */
44
+ return (-1 );
45
+ }
46
+ switch (who ) {
47
+ case RUSAGE_SELF :
48
+ u = tms .tms_utime ;
49
+ s = tms .tms_stime ;
50
+ break ;
51
+ case RUSAGE_CHILDREN :
52
+ u = tms .tms_cutime ;
53
+ s = tms .tms_cstime ;
54
+ break ;
55
+ default :
56
+ errno = EINVAL ;
57
+ return (-1 );
58
+ }
59
+ #define TICK_TO_SEC (T , RATE ) ((T)/(RATE))
60
+ #define TICK_TO_USEC (T ,RATE ) (((T)%(RATE)*1000000)/RATE)
61
+ rusage -> ru_utime .tv_sec = TICK_TO_SEC (u , tick_rate );
62
+ rusage -> ru_utime .tv_usec = TICK_TO_USEC (u , tick_rate );
63
+ rusage -> ru_stime .tv_sec = TICK_TO_SEC (s , tick_rate );
64
+ rusage -> ru_stime .tv_usec = TICK_TO_USEC (u , tick_rate );
65
+ return (0 );
66
+ }
Original file line number Diff line number Diff line change
1
+ /*-------------------------------------------------------------------------
2
+ *
3
+ * rusagestub.h--
4
+ * Stubs for getrusage(3).
5
+ *
6
+ *
7
+ * Copyright (c) 1994, Regents of the University of California
8
+ *
9
+ * $Id: rusagestub.h,v 1.1 1996/07/20 08:34:34 scrappy Exp $
10
+ *
11
+ *-------------------------------------------------------------------------
12
+ */
13
+ #ifndef RUSAGESTUB_H
14
+ #define RUSAGESTUB_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
+ #define RUSAGE_SELF 0
21
+ #define RUSAGE_CHILDREN -1
22
+
23
+ struct rusage {
24
+ struct timeval ru_utime ; /* user time used */
25
+ struct timeval ru_stime ; /* system time used */
26
+ };
27
+
28
+ extern int getrusage (int who , struct rusage * rusage );
29
+
30
+ #endif /* RUSAGESTUB_H */
Original file line number Diff line number Diff line change 6
6
*
7
7
* Copyright (c) 1994, Regents of the University of California
8
8
*
9
- * $Id: ipc.h,v 1.1.1.1 1996/07/09 06:21:52 scrappy Exp $
9
+ * $Id: ipc.h,v 1.2 1996/07/20 08:35:24 scrappy Exp $
10
10
*
11
11
* NOTES
12
12
* This file is very architecture-specific. This stuff should actually
30
30
* atomic test-and-set instruction). However, we have only written
31
31
* spinlock code for the architectures listed.
32
32
*/
33
- #if defined(PORTNAME_aix ) || \
33
+ #if ( defined(PORTNAME_aix ) || \
34
34
defined(PORTNAME_alpha ) || \
35
35
defined(PORTNAME_hpux ) || \
36
36
defined(PORTNAME_irix5 ) || \
37
37
defined(PORTNAME_next ) || \
38
38
defined(PORTNAME_sparc ) || \
39
39
defined(PORTNAME_sparc_solaris ) || \
40
- (defined(__i386__ ) && defined(__GNUC__ ))
40
+ (defined(__i386__ ) && defined(__GNUC__ ))) && \
41
+ !defined(PORTNAME_i386_solaris )
41
42
#define HAS_TEST_AND_SET
42
43
#endif
43
44
Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.1.1.1 1996/07/09 06:21:54 scrappy Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.2 1996/07/20 08:35:52 scrappy Exp $
11
11
*
12
12
* NOTES
13
13
*
@@ -47,7 +47,7 @@ int UsePrivateMemory = 1;
47
47
int UsePrivateMemory = 0 ;
48
48
#endif
49
49
50
- #if defined(PORTNAME_bsdi )
50
+ #if defined(PORTNAME_bsdi )|| defined( PORTNAME_i386_solaris )
51
51
/* hacka, hacka, hacka (XXX) */
52
52
union semun {
53
53
int val ; /* value for SETVAL */
Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.1.1.1 1996/07/09 06:21:57 scrappy Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.2 1996/07/20 08:35:58 scrappy Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
46
46
* This is so that we can support more backends. (system-wide semaphore
47
47
* sets run out pretty fast.) -ay 4/95
48
48
*
49
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.1.1.1 1996/07/09 06:21:57 scrappy Exp $
49
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.2 1996/07/20 08:35:58 scrappy Exp $
50
50
*/
51
51
#include <sys/time.h>
52
52
#ifndef WIN32
56
56
#include <sys/types.h>
57
57
#include "libpq/pqsignal.h" /* substitute for <signal.h> */
58
58
59
- #if defined(PORTNAME_bsdi )
59
+ #if defined(PORTNAME_bsdi )|| defined( PORTNAME_i386_solaris )
60
60
/* hacka, hacka, hacka (XXX) */
61
61
union semun {
62
62
int val ; /* value for SETVAL */
Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.1.1.1 1996/07/09 06:22:04 scrappy Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.2 1996/07/20 08:36:17 scrappy Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -1275,7 +1275,7 @@ static int isinf(x)
1275
1275
}
1276
1276
#endif /* PORTNAME_alpha */
1277
1277
1278
- #if defined(PORTNAME_sparc_solaris )
1278
+ #if defined(PORTNAME_sparc_solaris )|| defined( PORTNAME_i386_solaris )
1279
1279
#include <ieeefp.h>
1280
1280
static int
1281
1281
isinf (d )
You can’t perform that action at this time.
0 commit comments