X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=3.2 required=5.0	tests=AWL,BAYES_00,BOTNET,RCVD_IN_DNSWL_NONE
X-Spam-Check-By: sourceware.org
Message-id: <4D77C9C8.2000802@cygwin.com>
Date: Wed, 09 Mar 2011 13:41:12 -0500
From: "Larry Hall (Cygwin)" <reply-to-list-only-lh@cygwin.com>
Reply-to: cygwin@cygwin.com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.21) Gecko/20090320 Remi/2.0.0.21-1.fc8.remi Lightning/0.9 Thunderbird/2.0.0.21 Mnenhy/0.7.5.0
MIME-version: 1.0
To: cygwin@cygwin.com
Cc: wruck@tweerlei.de
Subject: Re: 1.7.8: write fails with EAGAIN
References: <4D72992D.4090007@tweerlei.de> <20110307103951.GL6393@calimero.vinschen.de> <4D77C5CB.1040909@tweerlei.de>
In-reply-to: <4D77C5CB.1040909@tweerlei.de>
Content-type: text/plain; charset=UTF-8; format=flowed
Content-transfer-encoding: 7bit
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 3/9/2011 1:24 PM, Robert Wruck wrote:
> 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.
>
> I checked out the winsup sources and built a cygwin1.dll for debugging (btw:
>  Could you update the FAQ to state that gcc4 is required instead of gcc?).
>
> What I found out:
>
> In fhandler.cc, write_overlapped, there is the call to WriteFile:
>
> bool res = WriteFile (get_output_handle (), ptr, len, &nbytes, get_overlapped
> ());
>
> Surprisingly, this returns FALSE / nbytes = 0 / GetLastError =
> ERROR_INVALID_HANDLE on WinXP if the number of bytes exceeds some maximum and
>  the handle refers to a pipe. Since you don't know what kind of handle you're
> writing to in write_overlapped, it seems reasonable to do the write in
> chunks.

<http://cygwin.com/ml/cygwin/2011-03/msg00280.html>

-- 
Larry

_____________________________________________________________________

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

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

