This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47694] [4.3/4.4/4.5/4.6 Regression] Fortran read from named pipe fails to read all available data
- From: "jb at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 15 Feb 2011 09:42:31 +0000
- Subject: [Bug fortran/47694] [4.3/4.4/4.5/4.6 Regression] Fortran read from named pipe fails to read all available data
- Auto-submitted: auto-generated
- References: <bug-47694-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47694
--- Comment #11 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-02-15 09:42:12 UTC ---
Unfortunately I don't think I'll have time to look into it this week.
As can be seen from Tobias patch, reading one character at a time is very slow.
But, the comment in read_sf() is wrong, it's not actually needed to read one
character at a time; what we need to do is to handle short reads correctly.
One fix, I suspect, would be to convert read_sf() to use fbuf_getc() instead,
which gives the impression of reading a character at a time, even though fbuf
takes care of doing buffered reads in the background. But in order to do that,
the read_sf() API needs to be changed so that a buffer is passed as an
argument, and this buffer is then filled with data, rather than returning a
pointer to the fbuf buffer.