Subject: Re: cp(1) vs. UVM/UBC
To: Matthias Buelow <>
From: Todd Vierling <>
List: tech-userlevel
Date: 07/21/2001 17:16:58
On Sat, 21 Jul 2001, Matthias Buelow wrote:

: >He is talking about smart userland code. "cp" e.g. would simply use the
: >old read(2) loop in this case.

Yes, but:

: Does mmapping a file for copying instead of simply reading it really
: pay off that much that it justifies complicating a silly little command
: like cp, and a long thread here?

My point was that, regardless of what cp(1) uses, filesystems which can
panic the system or break processes [where mmap(2) is broken under UBC] need
to make mmap fail in those cases until the problems can be fixed.

A side effect of this is that cp(1) could be made to mmap(2) files (a
significant performance gain wrt data copies), under the important note that
if mmap fails, it should fall back to read(2).

-- Todd Vierling <>  *  Wasabi NetBSD:  Run with it.
-- NetBSD 1.5 now available on CD-ROM  --