Re: readv() return and errno

Andries.Brouwer@cwi.nl
Tue, 26 Mar 2002 21:15:44 GMT


From jholly@cup.hp.com Tue Mar 26 18:13:40 2002

Doesn't seem confusing at all.

RETURN VALUE
On success readv returns the number of bytes read. On
success writev returns the number of bytes written. On
error, -1 is returned, and errno is set appropriately.

ERRORS
EINVAL An invalid argument was given. For instance count
might be greater than MAX_IOVEC, or zero. fd could
also be attached to an object which is unsuit-
able for reading (for readv) or writing (for
writev).

I don't see much in the way of waffle words. If count is greater than
MAX_IOVEC or zero you get EINVAL.

Yes, without hesitation you choose the wrong interpretation.
That is why I explained in so much detail what the right
interpretation is. Since you perhaps still do not understand,
let me reiterate:

The above ERRORS section says: In case this call returns EINVAL
one of the possible reasons is that an invalid argument was given.
There do exist Unix-like systems (not necessarily Linux) that
consider a zero count invalid.

Andries
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/