Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group