bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] read-file: Avoid memory reallocations with seekable files.


From: Paul Eggert
Subject: Re: [PATCH] read-file: Avoid memory reallocations with seekable files.
Date: Tue, 03 Aug 2010 16:32:42 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6

On 08/03/10 15:17, Bruno Haible wrote:
>> > and errno should be set to ENOMEM if overflow occurs.
> I disagree. In this case there's likely something fishy with the fstat
> results, and it's better to start reading from the stream, like for
> non-regular files.

Hmm, well, it could happen when reading from a 5-gigabyte
file on a 32-bit machine, which is not fishy and is
not that unlikely.  In this case, reading from the stream
will be pretty expensive and is likely to make the app
thrash pretty badly before it fails.  Perhaps there
are other scenarios where reading is a good idea when
overflow occurs, but nothing that-likely springs to mind.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]