[EXTERNAL] Re: scp stalls on uploading in cygwin 3.5 current master.

Corinna Vinschen corinna-cygwin@cygwin.com
Sat Aug 26 13:52:05 GMT 2023


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


More information about the Cygwin mailing list