Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5108a5b

Browse files
committed
More merges from Dr. George's tree...
- src/backend/tcop/* - cosmetic changes to OPENLINK patches - src/backend/storage/* - more changes, mostly cosmetic - src/backend/ports/* - merge in patches for aix and i386_solaris
1 parent 18a7989 commit 5108a5b

File tree

8 files changed

+106
-67
lines changed

8 files changed

+106
-67
lines changed

src/backend/port/aix/Makefile.inc

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/backend/port/aix/Attic/Makefile.inc,v 1.1.1.1 1996/07/09 06:21:41 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/backend/port/aix/Attic/Makefile.inc,v 1.2 1996/07/22 22:59:27 scrappy Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

@@ -26,9 +26,11 @@ HEADERS+= dlfcn.h machine.h port-protos.h
2626

2727
SUBSRCS+= dlfcn.c
2828

29+
MKLDEXPORT=$(POSTGRESDIR)/src/backend/port/aix/mkldexport.sh
30+
2931
${PROG}.exp: ${PROG}.noexp
3032
mv -f $(objdir)/${PROG}.noexp $(objdir)/${PROG}
31-
$(CURDIR)/port/aix/mkldexport.sh $(objdir)/${PROG} ${BINDIR} > $(objdir)/${PROG}.exp
33+
$(MKLDEXPORT) $(objdir)/${PROG} ${BINDIR} > $(objdir)/${PROG}.exp
3234
mv -f $(objdir)/${PROG} $(objdir)/${PROG}.noexp
3335

3436
${PROG}.noexp: ${OBJS}

src/backend/port/i386_solaris/Makefile.inc

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/backend/port/i386_solaris/Attic/Makefile.inc,v 1.1 1996/07/20 08:34:32 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/backend/port/i386_solaris/Attic/Makefile.inc,v 1.2 1996/07/22 22:59:34 scrappy Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

1414
CFLAGS+= -DUSE_POSIX_TIME -DNEED_ISINF -DNEED_RUSAGE -DNO_EMPTY_STMTS
1515

1616
LDADD+= -ll -ldl
1717

18-
SUBSRCS+= port.c
18+
SUBSRCS+= port.c tas.s
1919

2020
HEADERS+= machine.h port-protos.h rusagestub.h

src/backend/storage/buf_internals.h

+31-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: buf_internals.h,v 1.1.1.1 1996/07/09 06:21:52 scrappy Exp $
9+
* $Id: buf_internals.h,v 1.2 1996/07/22 22:59:42 scrappy Exp $
1010
*
1111
* NOTE
1212
* If BUFFERPAGE0 is defined, then 0 will be used as a
@@ -135,18 +135,41 @@ struct sbufdesc {
135135
* It eats up more shared memory, of course, but we're (allegedly)
136136
* going to make some of these types bigger soon anyway... -pma 1/2/93
137137
*/
138+
139+
/* NO spinlock */
140+
138141
#if defined(PORTNAME_ultrix4)
139142
char sb_pad[60]; /* no slock_t */
140143
#endif /* mips */
141-
#if defined(PORTNAME_sparc) || defined(PORTNAME_sparc_solaris) || defined(PORTNAME_irix5)
142-
char sb_pad[56]; /* has slock_t */
143-
#endif /* sparc || irix5 */
144-
#if defined(PORTNAME_hpux)
145-
char sb_pad[44]; /* has slock_t */
146-
#endif /* alpha */
144+
145+
/* HAS_TEST_AND_SET -- platform dependent size */
146+
147+
#if defined(PORTNAME_aix)
148+
char sb_pad[44]; /* typedef unsigned int slock_t; */
149+
#endif /* aix */
147150
#if defined(PORTNAME_alpha)
148-
char sb_pad[40]; /* has slock_t */
151+
char sb_pad[40]; /* typedef msemaphore slock_t; */
149152
#endif /* alpha */
153+
#if defined(PORTNAME_hpux)
154+
char sb_pad[44]; /* typedef struct { int sem[4]; } slock_t; */
155+
#endif /* hpux */
156+
#if defined(PORTNAME_irix5)
157+
char sb_pad[44]; /* typedef abilock_t slock_t; */
158+
#endif /* irix5 */
159+
#if defined(PORTNAME_next)
160+
char sb_pad[56]; /* typedef struct mutex slock_t; */
161+
#endif /* next */
162+
163+
/* HAS_TEST_AND_SET -- default 1 byte spinlock */
164+
165+
#if defined(PORTNAME_BSD44_derived) || \
166+
defined(PORTNAME_bsdi) || \
167+
defined(PORTNAME_i86pc_solaris) || \
168+
defined(PORTNAME_linux) || \
169+
defined(PORTNAME_sparc) || \
170+
defined(PORTNAME_sparc_solaris)
171+
char sb_pad[56]; /* has slock_t */
172+
#endif /* 1 byte slock_t */
150173
};
151174

152175
/*

src/backend/storage/file/fd.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright (c) 1994, Regents of the University of California
77
*
88
* IDENTIFICATION
9-
* $Id: fd.c,v 1.3 1996/07/18 04:59:42 scrappy Exp $
9+
* $Id: fd.c,v 1.4 1996/07/22 22:59:50 scrappy Exp $
1010
*
1111
* NOTES:
1212
*
@@ -62,11 +62,12 @@
6262
#define NOFILE NOFILE_IN_U
6363
#endif /* PORTNAME_sparc */
6464

65-
#ifdef PORTNAME_sparc_solaris
65+
#if defined(PORTNAME_sparc_solaris) || defined(PORTNAME_i386_solaris)
6666
#include <sys/user.h>
6767
#undef NOFILE
6868
#define NOFILE 64
69-
#endif /* PORTNAME_sparc_solaris */
69+
#endif /* PORTNAME_sparc_solaris || PORTNAME_i386_solaris */
70+
7071
/*
7172
* Problem: Postgres does a system(ld...) to do dynamic loading. This
7273
* will open several extra files in addition to those used by

src/backend/storage/ipc.h

+32-21
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: ipc.h,v 1.2 1996/07/20 08:35:24 scrappy Exp $
9+
* $Id: ipc.h,v 1.3 1996/07/22 22:59:43 scrappy Exp $
1010
*
1111
* NOTES
1212
* This file is very architecture-specific. This stuff should actually
@@ -30,71 +30,81 @@
3030
* atomic test-and-set instruction). However, we have only written
3131
* spinlock code for the architectures listed.
3232
*/
33-
#if (defined(PORTNAME_aix) || \
33+
#if defined(PORTNAME_aix) || \
3434
defined(PORTNAME_alpha) || \
35+
defined(PORTNAME_BSD44_derived) || \
36+
defined(PORTNAME_bsdi) || \
3537
defined(PORTNAME_hpux) || \
38+
defined(PORTNAME_i386_solaris) || \
3639
defined(PORTNAME_irix5) || \
40+
defined(PORTNAME_linux) || \
3741
defined(PORTNAME_next) || \
3842
defined(PORTNAME_sparc) || \
39-
defined(PORTNAME_sparc_solaris) || \
40-
(defined(__i386__) && defined(__GNUC__))) && \
41-
!defined(PORTNAME_i386_solaris)
43+
defined(PORTNAME_sparc_solaris)
4244
#define HAS_TEST_AND_SET
4345
#endif
4446

4547
#if defined(HAS_TEST_AND_SET)
4648

47-
#if defined(PORTNAME_next)
48-
/*
49-
* Use Mach mutex routines since these are, in effect, test-and-set
50-
* spinlocks.
51-
*/
52-
#undef NEVER /* definition in cthreads.h conflicts with parse.h */
53-
#include <mach/cthreads.h>
54-
55-
typedef struct mutex slock_t;
56-
#else /* next */
5749
#if defined(PORTNAME_aix)
5850
/*
5951
* The AIX C library has the cs(3) builtin for compare-and-set that
6052
* operates on ints.
6153
*/
6254
typedef unsigned int slock_t;
6355
#else /* aix */
56+
6457
#if defined(PORTNAME_alpha)
6558
#include <sys/mman.h>
6659
typedef msemaphore slock_t;
6760
#else /* alpha */
61+
6862
#if defined(PORTNAME_hpux)
6963
/*
7064
* The PA-RISC "semaphore" for the LDWCX instruction is 4 bytes aligned
7165
* to a 16-byte boundary.
7266
*/
7367
typedef struct { int sem[4]; } slock_t;
7468
#else /* hpux */
69+
7570
#if defined(PORTNAME_irix5)
7671
#include <abi_mutex.h>
7772
typedef abilock_t slock_t;
7873
#else /* irix5 */
74+
75+
#if defined(PORTNAME_next)
76+
/*
77+
* Use Mach mutex routines since these are, in effect, test-and-set
78+
* spinlocks.
79+
*/
80+
#undef NEVER /* definition in cthreads.h conflicts with parse.h */
81+
#include <mach/cthreads.h>
82+
typedef struct mutex slock_t;
83+
#else /* next */
84+
7985
/*
8086
* On all other architectures spinlocks are a single byte.
8187
*/
8288
typedef unsigned char slock_t;
89+
90+
#endif /* next */
8391
#endif /* irix5 */
8492
#endif /* hpux */
8593
#endif /* alpha */
8694
#endif /* aix */
87-
#endif /* next */
8895

8996
extern void S_LOCK(slock_t *lock);
9097
extern void S_UNLOCK(slock_t *lock);
9198
extern void S_INIT_LOCK(slock_t *lock);
9299

93-
#if defined(PORTNAME_hpux) || defined(PORTNAME_alpha) || defined(PORTNAME_irix5) || defined(PORTNAME_next)
100+
#if defined(PORTNAME_alpha) || \
101+
defined(PORTNAME_hpux) || \
102+
defined(PORTNAME_irix5) || \
103+
defined(PORTNAME_next)
94104
extern int S_LOCK_FREE(slock_t *lock);
95-
#else /* PORTNAME_hpux */
105+
#else
96106
#define S_LOCK_FREE(lock) ((*lock) == 0)
97-
#endif /* PORTNAME_hpux */
107+
#endif
98108

99109
#endif /* HAS_TEST_AND_SET */
100110

@@ -108,9 +118,10 @@ extern int S_LOCK_FREE(slock_t *lock);
108118
defined(PORTNAME_aix) || \
109119
defined(PORTNAME_alpha) || \
110120
defined(PORTNAME_hpux) || \
121+
defined(PORTNAME_i386_solaris) || \
111122
defined(PORTNAME_sparc_solaris) || \
112-
defined(WIN32) || \
113-
defined(PORTNAME_ultrix4)
123+
defined(PORTNAME_ultrix4) || \
124+
defined(WIN32)
114125
union semun {
115126
int val;
116127
struct semid_ds *buf;

src/backend/storage/ipc/s_lock.c

+12-10
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.3 1996/07/16 07:13:16 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.4 1996/07/22 23:00:03 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -70,8 +70,7 @@ S_INIT_LOCK(slock_t *lock)
7070
int
7171
S_LOCK_FREE(slock_t *lock)
7272
{
73-
/* For Mach, we have to delve inside the entrails of `struct
74-
mutex'. Ick! */
73+
/* For Mach, we have to delve inside the entrails of `struct mutex'. Ick! */
7574
return (lock->lock == 0);
7675
}
7776

@@ -159,9 +158,10 @@ S_LOCK_FREE(slock_t *lock)
159158
* Solaris 2
160159
*/
161160

162-
#if defined(PORTNAME_sparc_solaris)
161+
#if defined(PORTNAME_i386_solaris) || \
162+
defined(PORTNAME_sparc_solaris)
163163

164-
/* defined in port/.../tas.s */
164+
/* for xxxxx_solaris, this is defined in port/.../tas.s */
165165
extern int tas(slock_t *lock);
166166

167167
void
@@ -183,7 +183,7 @@ S_INIT_LOCK(slock_t *lock)
183183
S_UNLOCK(lock);
184184
}
185185

186-
#endif /* PORTNAME_sparc_solaris */
186+
#endif /* PORTNAME_i86pc_solaris || PORTNAME_sparc_solaris */
187187

188188
/*
189189
* AIX (POWER)
@@ -266,7 +266,7 @@ S_LOCK_FREE(slock_t *lock)
266266
* sun3
267267
*/
268268

269-
#if (defined(sun) && ! defined(sparc))
269+
#if (defined(sun3) && ! defined(sparc))
270270

271271
void
272272
S_LOCK(slock_t *lock)
@@ -381,8 +381,10 @@ S_INIT_LOCK(unsigned char *addr)
381381
* Linux and friends
382382
*/
383383

384-
#if defined(PORTNAME_linux) || defined(PORTNAME_BSD44_derived) || defined(PORTNAME_bsdi) || defined(PORTNAME_bsdi_2_1)
385-
384+
#if defined(PORTNAME_BSD44_derived) || \
385+
defined(PORTNAME_bsdi) || \
386+
defined(PORTNAME_bsdi_2_1) || \
387+
defined(PORTNAME_linux)
386388

387389
int
388390
tas(slock_t *m)
@@ -411,7 +413,7 @@ S_INIT_LOCK(slock_t *lock)
411413
S_UNLOCK(lock);
412414
}
413415

414-
#endif /* PORTNAME_linux || PORTNAME_BSD44_derived || PORTNAME_bsdi || PORTNAME_bsdi_2_1 */
416+
#endif /* linux and friends */
415417

416418

417419
#endif /* HAS_TEST_AND_SET */

src/backend/storage/smgr/md.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.3 1996/07/15 19:22:12 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.4 1996/07/22 23:00:18 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -476,8 +476,8 @@ mdblindwrt(char *dbstr,
476476
if (write(fd, buffer, BLCKSZ) != BLCKSZ || (pg_fsync(fd) < 0))
477477
#else
478478
if (write(fd, buffer, BLCKSZ) != BLCKSZ || fsync(fd) < 0)
479-
status = SM_FAIL;
480479
#endif
480+
status = SM_FAIL;
481481

482482
if (close(fd) < 0)
483483
status = SM_FAIL;

0 commit comments

Comments
 (0)