This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/47694] [4.3/4.4/4.5/4.6 Regression] Fortran read from named pipe fails to read all available data


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]