Nikolay Molchanov writes:
> 12580:        read(0, " y\n y\n", 4096)                       = 4
[...]
> 12585:        read(0, 0x080FC1E4, 4096)                       = 0
> 
> Obviously at this moment there is no way to get "y" from the input file.
> A suggested fix is to read only one line in /usr/sbin/pkgrm, when it needs 
> an answer on its first question.

I think what you're suggesting really isn't feasible.

Those are two different processes reading from the same pipe.  Pipes,
unlike ttys, don't respect line boundaries.  Thus, the reader gets all
the data he asks for.  The line-buffering then occurs inside stdio
itself, which will return just one line at a time if that's what the
caller requests.

When the second independent process comes along, nothing is left to
read.

To make the behavior work as you're suggesting, either stdio would
have to make read(2) calls of a single byte at a time when filling its
buffers (which would make everything very slow) or we'd need to add
something like ldterm(7M) to pipes.

Either way, the result would be strange, likely slow, possibly
incompatible with the standards, and very much unlike UNIX.

-- 
James Carlson, Solaris Networking              <[EMAIL PROTECTED]>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to