Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Sep 2002 13:47:24 -0600 (MDT)
From:      Tony Arcieri <tarcieri@atmos.colostate.edu>
To:        freebsd-doc@freebsd.org
Subject:   Error on manpage for shmctl()
Message-ID:  <20020927134016.D88535-100000@rylos.atmos.colostate.edu>

next in thread | raw e-mail | index | archive | help
I noticed that the documented behavior for how FreeBSD handles IPC_RMID to
be rather discontiguous with other platforms.  On my manpage for shmctl(),
at least the version included with FreeBSD 4.6, the behavior is described
as follows:

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.

This would be less than ideal, as it would then be impossible to
reclaim shared memory which was no longer needed by any processes attached
to it without said processes exiting, and any unused shared memory would
essentially be leaked.

I've tested it myself, and shared memory segments do appear to be
reclaimed (at least, according to ipcs) after shmctl() is called
with IPC_RMID and all processes have detached the shared memory segment
with shmdt().

So, either the memory isn't reclaimed and merely doesn't show up in ipcs
(in which case this behavior should probably be documented) or the
manpage is wrong.  I'd like to know what the answer is in either case.

I'm not subscribed to this list so please CC replies to me.

Tony Arcieri


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




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