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 libfortran/30162] [4.7/4.8 Regression] Unformatted sequential I/O with named pipes does not work


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?)


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