From: william E Davidsen (davidsen@ariel.crd.GE.COM)
Date: 07/28/92


From: davidsen@ariel.crd.GE.COM (william E Davidsen)
Subject: Re: I can't get mmap to work
Date: 28 Jul 1992 15:11:59 GMT

In article <SHARMAN.92Jul28002859@sharman.Software.Mitel.COM>, sharman@Software.Mitel.COM (Richard Sharman) writes:

| buff1 = (caddr_t) memalign(0x1000, LEN1) ;
        [ ... ]
| file1 = mmap(buff1, LEN1, PROT_READ, MAP_SHARED|MAP_FIXED, fd1, 0) ;

  Not having the docs for linux mmap(), I'm at a disadvantage here, but
unless they are totally different from the BSD/V.4/Xenix flavor they
adrs can be NULL to allow the system to use any part of your virtual
address space it wants. That sounds like a really good place to start
changing things. Then take that MAP_FIXED out of there and see if it
works better.

  I have never thought of a good reason why someone would want to decide
on the location of a mapped file, and it's always extra effort to find a
place to do the map. Just pass in and address of ((caddr_t)0) and
eliminate any problems caused by the address diddling you're doing.

  Ignore this if the current mmap() doesn't use the conventions other
systems do...

-- 
bill davidsen, GE Corp. R&D Center; Box 8; Schenectady NY 12345
        It never ceases to amaze me that otherwise rational people, able to
        understand calculus, compound interest, and the income tax form, can
        continue to believe that poker is a game of chance.