Re: Re: grep: very large file with no newline
Stepan Kasal <kasal@xxxxxx> wrote:
> On Sat, Nov 20, 2004 at 05:54:34PM +0100, Jim Meyering wrote:
>> Here, I suggest you just set errno not to saved_errno
>> but rather to ENOMEM, since saved_errno's value is not useful.
> yes, you are right. I attached an updated version of the patch.
> Is anyone willing to test it?
I've confirmed that it works, ...
$ dd bs=1 seek=4G of=big < /dev/null
$ (ulimit -v 10000; echo a|src/grep a big -)
grep: big: Cannot allocate memory
but bear in mind that my working directory is pretty hacked up: since
I couldn't get it to configure/build I pulled in bison's bootstrap
script and impatiently and recklessly chopped (removing lots of
conflicting/old/dos-related .m4 files) until everything compiled.