X-Recipient: archive-cygwin AT delorie DOT 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: cygwin AT cygwin DOT 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 AT cygwin DOT com Cc: wruck AT tweerlei DOT de Subject: Re: 1.7.8: write fails with EAGAIN References: <4D72992D DOT 4090007 AT tweerlei DOT de> <20110307103951 DOT GL6393 AT calimero DOT vinschen DOT de> <4D77C5CB DOT 1040909 AT tweerlei DOT 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 AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT 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. -- 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