This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/30162] [4.7/4.8 Regression] Unformatted sequential I/O with named pipes does not work
- From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 18 Feb 2013 21:46:58 +0000
- Subject: [Bug libfortran/30162] [4.7/4.8 Regression] Unformatted sequential I/O with named pipes does not work
- Auto-submitted: auto-generated
- References: <bug-30162-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30162
--- Comment #49 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2013-02-18 21:46:58 UTC ---
Here's a proof of concept patch which lets the
test cases "work" due to buffering.
Index: unix.c
===================================================================
--- unix.c (Revision 195922)
+++ unix.c (Arbeitskopie)
@@ -995,7 +995,8 @@
s->file_length = statbuf.st_size;
/* Only use buffered IO for regular files. */
- if (S_ISREG (statbuf.st_mode)
+ if ((S_ISREG (statbuf.st_mode)
+ || S_ISFIFO (statbuf.st_mode))
&& !options.all_unbuffered
&& !(options.unbuffered_preconnected &&
(s->fd == STDIN_FILENO
What it doesn't do is handle writes larger than
BUFSIZE, and this limitation is not communicated up
from the stream library to the record length, and also
not the other way. This would break the abstraction
(but maybe we would not care, would we?)