sysv_shmem potential problem - Mailing list pgsql-hackers

From lsunley@mb.sympatico.ca
Subject sysv_shmem potential problem
Date
Msg-id 0I9L004DLTLBGM@l-daemon
Whole thread Raw
Responses Re: sysv_shmem potential problem
List 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@mb.sympatico.ca
-----------------------------------------------------------



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: exception handling in plpgsql
Next
From: Tom Lane
Date:
Subject: Re: sysv_shmem potential problem