comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <dewar@gnat.com>
Subject: Re: MMAP in ADA?
Date: 1999/11/05
Date: 1999-11-05T00:00:00+00:00	[thread overview]
Message-ID: <7vur6c$o3n$1@nnrp1.deja.com> (raw)
In-Reply-To: 38223922.7763122E@boeing.com

In article <38223922.7763122E@boeing.com>,
  Robert Jordan <robert.l.jordan@boeing.com> wrote:
> And yes... I know I could just pragma import the unix mmap
> function, but I'm trying to avoid all imports in my ADA code
> (Per instruction).

Obviously a function like mmap cannot be part of the Ada
language per se, since it is clearly not type safe. So you
are looking for a library function in any case.

I think you should interpret the ("per instruction") to mean
that if there is an Ada function that does what you want, you
should use it instead of importing something from C (everyone
in fact will agree with this, e.g. use an Ada protected type,
rather than import some target dependent operating systems
functions for doing low level locks, as you would have to
in C or C++).

But in a case like this, where you are talking about a facility
which is not going to be in *any* language (it is certainly not
part of C or C++), then you have to import it from a library
anyway. At that stage, it should make no difference to you or
to whomever is issuing your "instruction" whether the library
from which you are importing it is written in C, or whatever
other language.

Now there *is* a facility in Ada that *might* do some of what
mmap does in *certain* cases on *some* implementations, and
that is passive partitions. GNAT fully implements passive
partitions in a way that provides program to program
communication and persistance, but it does not use a shared
memory mechanism to do this.

In any case, GNAT is the only Ada 95 implementation that
contains a full implementation of Annex E, so in practice
you will be *more* portable using mmap directly here, not less.
(also I don't think the GNAT implementation is what you want
here in any case).

Robert Dewar


Sent via Deja.com http://www.deja.com/
Before you buy.




  parent reply	other threads:[~1999-11-05  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-05  0:00 MMAP in ADA? Robert Jordan
1999-11-04  0:00 ` David C. Hoos, Sr.
1999-11-08  0:00   ` Nick Roberts
1999-11-05  0:00 ` Robert Dewar [this message]
1999-11-05  0:00   ` Robert Jordan
1999-11-06  0:00     ` Robert Dewar
1999-11-08  0:00       ` Samuel T. Harris
1999-11-05  0:00 ` Samuel Tardieu
replies disabled

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