> our reference is not a reference to the shared memory object, but to the 
> filenode.
> So we need three states: no senders, one, or many (the "one" is useful 
> if we want to know
> if we are the only mapper).
> 
> This is as much as we need to make users of nattach in SysV SHM happy.
> We know it is a questionable interface, but it is exactly the one extra 
> quirk
> we need for compatibility. (And if you know a better way, share it!)

There is not necessarily a single memory object.  Nothing says io_map can't
return different objects in different calls, as long as the sharing of the
actual data when mapped happens.  I hope this further emphasizes how
inappropriate a question it is to ask, "How many send rights are there to
the memory object?"  For other reasons, it is just about as inappropriate
to ask, "How many send rights are there to any such memory objects?"  A
question that is certainly reasonable is, "Is it known that there are no
mappings?"  It is also reasonable to ask, "Is it likely that there are
multiple mappings?"  Beyond that, you really can't necessarily pin it down
without undesireable presumptions about the natures of IPC and VM.  For
this, you need a bit and a half.  It seems reasonable to me to use two new
bits in st_mode and be done with it.  e.g.

#define S_IMAPPED    000100000000 /* Might be mmap'd.  */
#define S_IMAPPEDM   000200000000 /* Might be mmap'd more than once.  */


_______________________________________________
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd

Reply via email to