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

Re: [PATCH v20210601 04/38] tools: add readv_exact to libxenctrl



On 02.06.21 12:57, Olaf Hering wrote:
Am Wed, 2 Jun 2021 08:30:08 +0200
schrieb Juergen Gross <jgross@xxxxxxxx>:

On 01.06.21 18:10, Olaf Hering wrote:
+int readv_exact(int fd, const struct iovec *iov, int iovcnt)

+        if ( len <= 0 )
+        {
+            rc = -1;
Is EOF really an error?

I think yes, that's what "exact" implies IMO.

Shouldn't you check for zero length iovec elements as in the
writev_exact() case then?

This will stop the loop, even if idx hasn't reached iovcnt.

Yes, it will trigger yet another readv().

Ah, right.


Juergen

Attachment: OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.