Subject: Re: mmap (was Re: bin/10625: /usr/bin/cmp)
To: None <tech-userlevel@netbsd.org>
From: Wolfgang Rupprecht <wolfgang@wsrcc.com>
List: tech-userlevel
Date: 07/28/2000 14:00:47
woods@weird.com (Greg A. Woods) writes:
> [ On , July 28, 2000 at 13:12:54 (-0700), Wolfgang Rupprecht wrote: ]
> > Subject: mmap (was Re: bin/10625: /usr/bin/cmp)
> > Currently mmap() doesn't know how to extend a file.  So even if one
> > mmaps in extra space at the end of a file, one gets a SIGBUS if one
> > tries to write to it.  
> Perhaps mmap() shouldn't be used to write to files.  Indeed this is yet
> another reason why use of mmap() should normally be hidden away in a
> more generic library interface where its idiosyncracies can be carefully
> coded around once.

My reason for using mmap is because I'm hacking (up to) 600Meg files.
There is no fscking way I'm going to run all that crap through the
buffer cache if I don't need to.

Hiding mmap() in a library will make the programmer interface look
nicer, but if the underlying foundation doesn't work well I'm still
left with needless inefficiencies.  Unmapping, seeking, writing a byte
and remapping is a silly waste of CPU.  (And I'm not even convinced
that they buffer-cache and the mmaped data are ever guaranteed to be
in sync.)

-wolfgang
-- 
       Wolfgang Rupprecht <wolfgang+gnus@dailyplanet.wsrcc.com>
		    http://www.wsrcc.com/wolfgang/
DGPS signals via the Internet  http://www.wsrcc.com/wolfgang/gps/dgps-ip.html