From: Junio C Hamano Date: Tue, 15 Dec 2015 01:40:47 GMT Subject: Re: [PATCH 3/8] xread_nonblock: add functionality to read from fds without blocking Message-ID: In-Reply-To: <20151214235736.GA26133@sigill.intra.peff.net> Jeff King writes: > Are we trying to protect ourselves against somebody _else_ giving us a > non-blocking descriptor? In that case we'll quietly spin and waste CPU. > Which isn't great, but perhaps better than returning an error. I think I said it earlier in a message upthread. > Ahh, there is a difference if the file descriptor the caller feeds > strbuf_read_once() happens to be marked as nonblock. read_once() > wants to return without doing the poll() in such a case. Even > though this series would not introduce any use of a nonblocking file > descriptor, as a general API function, [4/8] must be prepared for > such a future caller, hence [3/8] is needed.