Subject: Re: bin/10625: /usr/bin/cmp is unable to compare rather large files
To: Greg A. Woods <woods@weird.com>
From: Andrew Brown <atatat@atatdot.net>
List: netbsd-bugs
Date: 07/27/2000 10:50:36
>However I'm not sure the bug is *really* fixed.  Shouldn't the test used
>to avoid mmap() be to see if the length is bigger than (SIZE_T_MAX / 2)?

if mmap is so great, wouldn't it make sense to use a moving mmap (ie,
mmap, scan, munmap, mmap next chunk...) instead of falling back to
plain old read?

then again...if mmap is so great, why doesn't cat use it?  then cat
would be just six system calls for each (regular) file.

>Does mmap() really fail if the file is bigger than the *remaining* size
>of the process's address space (the manual page makes no obvious claims
>along these lines)?

common sense says it should.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."