Subject: Re: bin/8681: grep may bomb out with "memory exhausted"
To: R. C. Dowdeswell <elric@imrryr.org>
From: Richard Earnshaw <rearnsha@arm.com>
List: netbsd-bugs
Date: 10/28/1999 11:04:23
elric@mabelode.imrryr.org said:
> Why not mmap(2) the file MAP_SHARED and PROT_READ.  It's not like grep
> is going to modify the pages, and shared pages shouldn't be counted
> towards memory usage as they are only backed on disk.

I haven't looked at the code, but it's probably to avoid having to 
special-case <stdin>.

R.