From owner-freebsd-hackers Sun May 31 14:15:29 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA23304 for freebsd-hackers-outgoing; Sun, 31 May 1998 14:15:29 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp01.primenet.com (daemon@smtp01.primenet.com [206.165.6.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA23230 for ; Sun, 31 May 1998 14:14:57 -0700 (PDT) (envelope-from tlambert@usr06.primenet.com) Received: (from daemon@localhost) by smtp01.primenet.com (8.8.8/8.8.8) id OAA26902; Sun, 31 May 1998 14:14:56 -0700 (MST) Received: from usr06.primenet.com(206.165.6.206) via SMTP by smtp01.primenet.com, id smtpd026874; Sun May 31 14:14:55 1998 Received: (from tlambert@localhost) by usr06.primenet.com (8.8.5/8.8.5) id OAA14092; Sun, 31 May 1998 14:14:47 -0700 (MST) From: Terry Lambert Message-Id: <199805312114.OAA14092@usr06.primenet.com> Subject: Re: Star Office Installation To: street@iname.com (Kevin Street) Date: Sun, 31 May 1998 21:14:47 +0000 (GMT) Cc: dfr@nlsystems.com, hasty@rah.star-gate.com, tlambert@primenet.com, mike@smith.net.au, rminnich@Sarnoff.COM, doconnor@gsoft.com.au, hackers@FreeBSD.ORG In-Reply-To: <13681.44921.894518.950536@kstreet.interlog.com> from "Kevin Street" at May 31, 98 03:50:02 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Setting IPC_RMID is the right thing to do, but the code has to be > somewhat smart about when to do it, because (from man shmctl): > > IPC_RMID Removes the segment from the system. The removal will not > take effect until all processes having attached the > segment have exited; however, once the IPC_RMID operation > has taken place, no further processes will be allowed > to attach the segment. ... > > On Linux it's easier because you don't need to wait until all the > attaches have been done before setting IPC_RMID. The linux emulation > layer must be doing something about this difference in semantics or > we'd probably see lots of failed attaches from Linux code. Linux is in violation of SVID III, aparently, in allowing subsequent attaches... unless FreeBSD is? I don't have my copy handy right now. Do the emulation layers support virtual marking classes of operations? It seems to me that to emulate this behaviour without adulterating FreeBSD's SysV IPC into SVID non-compliance, you would need to: 1) Reference count the segment (already done?). 2) Note that the Linux IPC_RMID had been set, but *not* set it. 3) Establish a handler to be called on exit such that the emulation layer can track resources on behalf of the emulated environment. 4) In the handler, note that the reference count on the segment is transiting from 1->0, and remove the segment. One problem with this is that the exit order may not be such that the setter of the IPC_RMID virtual mark exits last; if so, then the virtual mark needs to be visible to all processes running from the emulation environment. Note: doing this damages the ability to have both Linux and FreeBSD processes communicating via the same segment, such as when running Linux X clients (using the SHM extension) against a FreeBSD X server. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message