From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id A00973858C33; Sat, 26 Aug 2023 13:52:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A00973858C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1693057927; bh=sbX2mTGM0OesexSFRU10MDDPvzzj3WsTZDlonBO/Hcc=; h=Date:From:To:Subject:Reply-To:References:In-Reply-To:From; b=TPpvG9+AYrgbEYw7TOH8hCQwe7nbjOIF1RpJ63bniAQokYQIuaMU6nT16uacW3HQ3 eTZ1MNjhF5fHSvf6aXQ1GJPQIoc9eq52tlasejmA9K3GRffOEbmeP2gsHY7AfeN9i2 UphM2QzyuEukIpYHdF407rqIEpthVSRA6alBstCc= Received: by calimero.vinschen.de (Postfix, from userid 500) id 8A5D8A80CAB; Sat, 26 Aug 2023 15:52:05 +0200 (CEST) Date: Sat, 26 Aug 2023 15:52:05 +0200 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: [EXTERNAL] Re: scp stalls on uploading in cygwin 3.5 current master. Message-ID: Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20230824060502.c4798062cb19d4d35a5633ae@nifty.ne.jp> <20230824123131.390b4471915c963425c77608@nifty.ne.jp> <20230825174832.9ebae8112667d5d5411cb8db@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Id: On Aug 25 23:27, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via Cygwin wrote: > > While select indicates that > > data can be written, it doesn't indicate how much data can be written. > > I. e., if select returns, and there's only buffer space for 10 bytes, > > and the send call tries to send 100 bytes, it *will* block, unless the > > socket is non-blocking and returns EAGAIN. > > IIRC, if there's space for 10 bytes in the internal buffer, send(100) > will return 10, whether or not the socket is blocking. It doesn't, afaics. It raises the buffer size until something a bit less than 512K and then it starts blocking. > EAGAIN is only returned when nothing at all can be written to a > non-blocking socket; or send() blocks (when blocking). This thread is not about send() blocking or returning EAGAIN. This is about the behaviour of select(2) and poll(2). Corinna