sysv_shmem potential problem

From: lsunley(at)mb(dot)sympatico(dot)ca
To: pgsql-hackers(at)PostgreSQL(dot)org
Subject: sysv_shmem potential problem
Date: 2004-12-31 19:39:23
Message-ID: 0I9L004DLTLBGM@l-daemon
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

I am using the sysv_shmem.c shared memory allocation api for os/2 and I
ran into a problem when OS/2 allocates shared memory over the 2 gigabyte
address boundary.

The existing sysv_shmem.c tests for the return address of the segment as
less than 0 and determines that a negative indicates an error.

I have this patch (below) ifdef'd for OS/2 but I thought that there may be
a problem on other platforms that can allocate shared memory over the 2
gig boundary

The existing code is

if (shmid < 0)

Index: sysv_shmem.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/port/sysv_shmem.c,v
retrieving revision 1.41
diff -r1.41 sysv_shmem.c
80a81,85
> #ifdef __OS2__
> /* shared memory address may be allocated over 2 gig and will negative */
> /* so test for the explicit -1 return */
> if (shmid == -1)
> #else
81a87
> #endif

--
-----------------------------------------------------------
lsunley(at)mb(dot)sympatico(dot)ca
-----------------------------------------------------------

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2004-12-31 19:51:48 Re: contrib regression on old versions
Previous Message Joshua D. Drake 2004-12-31 19:37:27 TSearch still in contrib?