Re: [PATCHv3 03/13] xread_nonblock: add functionality to read from fds nonblockingly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stefan Beller <sbeller@xxxxxxxxxx> writes:

> This wrapper just restarts on EINTR, but not on EAGAIN like xread
> does. This gives less guarantees on the actual reading rather than
> on returning fast.

The last sentence is a bit hard to parse, by the way.

It lets caller make some progress without stalling by marking the
file descriptor as nonblocking and calling this function, compared
to calling xread() which will not give control back until reading
the asked size (or EOF).

It is not like "reading in full is always the desireable thing to
do, and returning early is something that needs compromise on that
desirable behaviour to achieve", which was the way I read your
version.  These two kinds of callers want two different things, but
the phrase "less guarantees" conveys a misguided value judgement (in
that "wanting to read in full always trumps other considerations" is
the stance the person who is making the judgement makes) more than
useful information (e.g. "the caller may want the control back
without stalling, in which case this is a useful thing to use").

The implementation itself is exactly like we discussed, and looks
good.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]