1.7.8: write fails with EAGAIN

Robert Wruck wruck@tweerlei.de
Mon Mar 7 12:17:00 GMT 2011


Hi,

> Hang on, you are saying that a *blocking* write(2) to a pipe returns
> with EAGAIN?  Are you sure?  It would be quite a surprise if git would
> actually do that.  EAGAIN is only an expected error for non-blocking
> I/O, so applications which use blocking I/O usually only test for EINTR.

since in the interesting case I'm writing to stdout (fd=1) I don't know 
whether that was initially opened with O_NONBLOCK - but I wouldn't think so.

I was able to reproduce this as follows:

./writetest infile | cat > outfile

where infile is a "large" file.
The output is:

$ ./writetest infile | cat > test.out
writing 78954543 bytes...
result is -1, errno is 11
writing 78954543 bytes...
result is -1, errno is 11
...

This does not happen for "small" files:

$ ./writetest infile2 | cat > test.out
writing 10978848 bytes...
result is 10978848, errno is 0

Also, I tried this with the same cygwin version on Win7/64-bit and this 
did not happen even for a 1GB file.


-Robert

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list