Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Apr 2006 11:08:11 -0500
From:      Craig Boston <craig@feniz.gank.org>
To:        Vivek Khera <vivek@khera.org>
Cc:        freebsd-stable <freebsd-stable@freebsd.org>
Subject:   Re: [HACKERS] semaphore usage "port based"?
Message-ID:  <20060404160810.GA25106@nowhere>
In-Reply-To: <136F2379-153C-4013-BEC1-2BBA36129810@khera.org>
References:  <Pine.GSO.4.43.0604030817090.21105-100000@sea.ntplx.net> <20060403140902.C947@ganymede.hub.org> <20060403182504.S76562@fledge.watson.org> <20060403144916.J947@ganymede.hub.org> <20060403230850.P76562@fledge.watson.org> <20060403205630.N947@ganymede.hub.org> <136F2379-153C-4013-BEC1-2BBA36129810@khera.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--Kj7319i9nmIyA2yE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, Apr 04, 2006 at 10:17:18AM -0400, Vivek Khera wrote:
> Perhaps you can hack into the postgresql master a flag that alters  
> the "1000" parameter, or starts at a port * 1000 + N, then hard-code  
> that flag into your startup script per jail.

A quick and dirty hack to fudge with the requested semid (and shared
memroy identifier) is attached.  Replace XXX with an arbitrary number.

It would be better if this was configurable, but doing it that way works
well enough for what I need, and may at least give an idea where to
start on a better workaround.

Craig

--Kj7319i9nmIyA2yE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-postgresql-shmem

--- src/backend/storage/ipc/ipci.c.orig	Tue Feb 28 10:09:23 2006
+++ src/backend/storage/ipc/ipci.c	Tue Feb 28 10:09:38 2006
@@ -102,14 +102,14 @@
 		/*
 		 * Create the shmem segment
 		 */
-		seghdr = PGSharedMemoryCreate(size, makePrivate, port);
+		seghdr = PGSharedMemoryCreate(size, makePrivate, port + XXX);
 
 		/*
 		 * Create semaphores
 		 */
 		numSemas = ProcGlobalSemas();
 		numSemas += SpinlockSemas();
-		PGReserveSemaphores(numSemas, port);
+		PGReserveSemaphores(numSemas, port + XXX);
 	}
 	else
 	{

--Kj7319i9nmIyA2yE--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060404160810.GA25106>