mmap changes, mostly for aout right now

Arne H. Juul
Tue Nov 7 17:10:00 GMT 1995

 > I've just checked in now some changes to bfd to use mmap for reading
 > files under certain circumstances.  A snapshot file should be available
 > within the next hour or so.  Please try it out and let me know of any
 > problems.
 > Under NetBSD (on i386), I saw no significant change in CPU time used
 > (though my test case was different -- many more small files in and out of
 > libraries).

Unless I'm very mistaken, using mmap is currently a *very* bad idea
on NetBSD.  The buffer cache and VM system hasn't been merged, and this
leads to lots of trouble when using mmap(), at least on NFS-mounted
filesystems - the file as seen by read/write can be wildly different from
the mmap view.  This will (hopefully) change later on, but currently using
mmap() on NetBSD in other than very carefully controlled circumstances
will probably lead to disaster.

  -  Arne H. J.

More information about the Gas2 mailing list