From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a744520307161f16 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: MMAP in ADA? Date: 1999/11/05 Message-ID: <7vur6c$o3n$1@nnrp1.deja.com>#1/1 X-Deja-AN: 544763075 References: <38223922.7763122E@boeing.com> X-Http-Proxy: 1.0 x37.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Fri Nov 05 14:56:24 1999 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-11-05T00:00:00+00:00 List-Id: In article <38223922.7763122E@boeing.com>, Robert Jordan 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.