comp.lang.ada
 help / color / mirror / Atom feed
From: "Mattias  Lindblad" <matlin@gmail.com>
Subject: Re: POSIX_Generic_Shared_Memory
Date: 29 Sep 2004 05:09:39 -0700
Date: 2004-09-29T05:09:39-07:00	[thread overview]
Message-ID: <1096459779.696500.183000@k26g2000oda.googlegroups.com> (raw)
In-Reply-To: m3mzzb8mol.fsf@0x535ba173.boanxx18.adsl-dhcp.tele.dk

> Try to look in the file posix-generic_shared_memory.adb for the two
> functions you use and inspect that they contain the following
statement:
>
>   if Protection = POSIX.Memory_Mapping.Allow_Write then
>       Mode := POSIX.IO.Read_Write;
>   else Mode := POSIX.IO.Read_Only;
>   end if;

Yes, this is what my versions look like. And yes, I agree that we
shouldn't really blame Florist for this. I would probably interpret the
standard in the same way.

Unfortunately, this leaves these functions practically unusable in my
opinion. However, I think it would be possible to change the
implementation to a usable version and still be compliant with the
standard. The standard does not mention anything about the protection
parameter that is sent to the intrinsic calls to Map_Memory. This means
that an implementation could set the protection options in the
Map_Memory call to (Allow_Read + Allow_Write) in the case where the
received protection parameter is Allow_Write. The only downside I can
think of is that you wouldn't be able to create a write-only shared
memory partition. In my opinion, this is definitely less of a problem
than the current situation where you cannot create a read-write
partition.

But ultimately, a better solution would be to change the text in the
standard to read something like "If Allow_Write is a subset of
Protection, Mode is Read_Write; otherwise Mode is Read_Only." This
would solve the problem in a better way. The protection options could
then be passed straight through to Map_Memory, which I think is the
most logical way. And I don't think a change of implementations to
support this would break any existing code. 

//Mattias




      parent reply	other threads:[~2004-09-29 12:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-20 17:23 POSIX_Generic_Shared_Memory Mattias Lindblad
2004-09-22 14:52 ` POSIX_Generic_Shared_Memory Paul Colin Gloster
2004-09-22 16:18   ` POSIX_Generic_Shared_Memory Mattias Lindblad
2004-09-27 20:46 ` POSIX_Generic_Shared_Memory Mark Lorenzen
2004-09-27 21:51   ` POSIX_Generic_Shared_Memory Ludovic Brenta
2004-09-29 12:09   ` Mattias  Lindblad [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox