running msys under wine

Ambroz Bizjak ambro at b4ever.net
Sat Jan 10 03:23:49 CST 2009


On Saturday 10 January 2009 01:05:07 David Laight wrote:
> On Fri, Jan 09, 2009 at 06:39:27PM +0000, Luke Kenneth Casson Leighton 
wrote:
> > further up the strace files, i'm looking at the biggest offender and
> > it looks like it's reading files one byte at a time.
>
> Certainly a normal unix shell has to read input (from stdin) byte by byte
> since it never knows when it might have to fork a process passing stdin
> through - and the child needs the correct file offset.
> (And the unix kernel doesn't have a 'read until newline' for files.)
>
> If stdin is seekable or mapable there are other options, but that is
> difficult to detect and code for.
>
> 	David
Hi,
I don't think this is true. When the shell forks to create a child, it doesn't 
have to give the child the same standard file descriptors - rather it creates 
pipes, and it passes stdin to the child by reading its own stdin than writing 
the data to the child's stdin pipe. This way it can filter the input (like for 
control sequences). So, if it has any excess input data when it creates a 
child, it simply writes that data to the stdin pipe first.
That is how I think things are and should be done.

    Ambroz



More information about the wine-devel mailing list