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.
