Subject: Re: bin/1697: vi bug (mmap() of remote file is not consistent)
To: None <netbsd-bugs@NetBSD.ORG>
From: Mike Long <mike.long@analog.com>
List: netbsd-bugs
Date: 10/30/1995 13:33:42
der Mouse <mouse@Collatz.McRCIM.McGill.EDU> wrote:

>> >Synopsis:       vi uses mmap() instead of read(); can corrupt remote files
>
>This is a bug in the VM subsystem, exhibited by mmap, not a bug in vi.
>"Fixing" it by changing vi would be like "fixing" a compiler that
>botched typedef declarations by using #defines instead of typedefs.

Your analogy oversimplifies the problem.  VM/buffer cache integration
is a major architectural change to the kernel; I don't expect that it
will happen anytime soon.

A precedent for the desired change to vi may be found in /bin/cp; the
mmap() code was commented out so that cp now uses read() exclusively.
vi should be fixed similarly, so that use of mmap() may be easily
restored when the buffer cache integration does occur.
-- 
Mike Long <mike.long@analog.com>           http://www.shore.net/~mikel
VLSI Design Engineer         finger mikel@shore.net for PGP public key
Analog Devices, CPD Division          CCBF225E7D3F7ECB2C8F7ABB15D9BE7B
Norwood, MA 02062 USA                assert(*this!=opinionof(Analog));