[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: closein, freadahead and ungetc
From: |
Eric Blake |
Subject: |
Re: closein, freadahead and ungetc |
Date: |
Fri, 29 Feb 2008 06:36:46 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Bruno Haible on 2/29/2008 3:49 AM:
| With strace you can see that there is only a single read() from the file
| descriptor. I.e. at the moment when freadahead() returns 0, it is only
| the ungetc-backup-buffer which has been emptied; the main buffer still
| contains 685 bytes.
|
| Where to fix this? In closein.c? Or in freadahead.c?
It seems like freadahead should add together the length of the ungetc
buffer and the read buffer, if we can easily get to both those pieces of
information - the contract of freadahead is that it tries to report how
many bytes can be read from the stream without requiring another
underlying read().
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHyApu84KuGfSFAYARAlAsAKDHq/TGrozG8PU+Z1ocBNxAXgSziACglD3u
qFXTh1EFS4Y/b5aF6lfLHf8=
=MuLD
-----END PGP SIGNATURE-----