Skip to content

Commit 411cf2d

Browse files
committed
attached to this mail is a patch from a colleague that makes
PostgreSQL-7.0.2 run on Linux for the Intel-IA64 architecture. It also fixes a bug in the configure scripts that caused configure to fail on the fcntl(F_SETLK) test. This fix triggered a bug in the fcntl(F_SETLK) code of the Linux kernel when used on unix domain sockets resulting in postmaster to segfault immediately after startup. There is a fix available and included in the kernel that will be on SuSE Linux 7.0, but kernels <= 2.2.16 still have this bug. Reinhard Max
1 parent 972604e commit 411cf2d

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

configure.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,8 @@ PGAC_UNION_SEMUN
764764

765765

766766
AC_MSG_CHECKING(for fcntl(F_SETLK))
767-
AC_TRY_LINK([#include <fcntl.h>],
767+
AC_TRY_LINK([#include <stdio.h>
768+
#include <fcntl.h>],
768769
[struct flock lck;
769770
lck.l_whence = SEEK_SET; lck.l_start = lck.l_len = 0;
770771
lck.l_type = F_WRLCK;

src/include/port/linux.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ typedef unsigned int slock_t;
3333
#define HAS_TEST_AND_SET
3434

3535
#elif defined(__arm__)
36-
typedef unsigned char slock_t
36+
typedef unsigned char slock_t;
37+
38+
#define HAS_TEST_AND_SET
39+
40+
#elif defined(__ia64__)
41+
typedef unsigned int slock_t;
3742

3843
#define HAS_TEST_AND_SET
3944

src/include/storage/s_lock.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.70 2000/04/12 17:16:51 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.71 2000/07/05 16:09:31 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -95,6 +95,24 @@ __asm__("lock; xchgb %0,%1": "=q"(_res), "=m"(*lock):"0"(_res));
9595
#endif /* __i386__ */
9696

9797

98+
#ifdef __ia64__
99+
#define TAS(lock) tas(lock)
100+
101+
static __inline__ int
102+
tas (volatile slock_t *lock)
103+
{
104+
long int ret;
105+
106+
__asm__ __volatile__(
107+
"xchg4 %0=%1,%2"
108+
: "=r"(ret), "=m"(*lock)
109+
: "r"(1), "1"(*lock)
110+
: "memory");
111+
112+
return (int) ret;
113+
}
114+
#endif /* __ia64__ */
115+
98116

99117
#if defined(__arm__) || defined(__arm__)
100118
#define TAS(lock) tas(lock)

0 commit comments

Comments
 (0)