Subject: Re: bin/10625: /usr/bin/cmp is unable to compare rather large files
To: Greg A. Woods <>
From: Andrew Brown <>
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" >-----|             * "ah!  i see you have the internet (Andrew Brown)                that goes *ping*!"       * "information is power -- share the wealth."