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=-0.8 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9a5e0182cbfaa45b X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!p26g2000yqb.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: Does mmap gives a right result?! Date: Sun, 3 Oct 2010 12:32:25 -0700 (PDT) Organization: http://groups.google.com Message-ID: <883039ec-23a1-49ff-b633-363a3775a5b2@p26g2000yqb.googlegroups.com> References: <459d08e4-1370-4925-9d9f-64ee0f472c19@f25g2000yqc.googlegroups.com> NNTP-Posting-Host: 174.28.201.29 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1286134355 22490 127.0.0.1 (3 Oct 2010 19:32:35 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 3 Oct 2010 19:32:35 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p26g2000yqb.googlegroups.com; posting-host=174.28.201.29; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 ( .NET CLR 3.5.30729; .NET CLR 4.0.20506),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:14371 Date: 2010-10-03T12:32:25-07:00 List-Id: On Oct 3, 1:22=A0pm, Francesco PIRANEO GIULIANO wrote: > Bjorn, > Jeff, > > Thank you for your answer. > > I'm going to download and try GNAT component collection; before this > Jeff I think you have reason: > > The original C code looks like: > fbuffer =3D mmap(NULL, fix.smem_len, PROT_READ | PROT_WRITE, MAP_FILE | > MAP_SHARED, fb_fd, 0); > > and I translated it into: > fbindex :=3D mmap(0, fbhandler.fixinfo.smem_len, fbhandler.PROT_READ + > fbhandler.PROT_WRITE, fbhandler.MAP_FILE + fbhandler.MAP_SHARED, fbid, > 0); > > ...not the same! :-) Maybe if I'll try to change the "0" to "NULL" it > will works... maybe! > > There is an equivalence of the C's NULL in Ada? > > Thank you again. > Francesco Like too many things in C NULL is somewhat ill-defined; do you mean the character-sized all-zero value used to terminate strings, or the all-zero valued memory-address sized pointer value? By the context here it is obvious that the later is what you're asking about but Ada provides both: There is the Character NUL and the "null" keyword which, in access-terms, is the null-pointer, the "null" keyword resolves down to other meanings depending on the context: the null- statement, a null-record, etc.