readv() return and errno
Quoted 2 lines · Jim Hollenback
According to readv(2) EINVAL is returned for an invalid argument.
Right.
Quoted 2 lines
The examples given were count might be greater than
MAX_IOVECor zero.
Wrong, or at least confusingly phrased.
In the good old days, a man page described what the system did, and the ERRORS section gave the reasons for the possible error returns.
These days a man page describes a function present on many Unix-like systems, and not all systems have precisely the same behaviour. POSIX man pages therefore distinguish under ERRORS the two possibilities "if foo then this error must be returned", and "if foo then this error may be returned".
Linux man pages do not (yet) make this distinction - adding this is a lot of careful work, and so far nobody is doing this [hint..].
In other words, the ERRORS section in Linux man pages is to be interpreted as "if foo then this error may be returned".
Note that it may not be desirable at all to do things that way, there is no need for kernel patches, it just means that systems exist with this behaviour, so that authors of portable programs must take this into account.
Quoted 1 line · Balbir Singh
Apply this trivial patch, if you want the required behaviour
But the behaviour is not required.
Paul Larson makes the same mistake.
Andries
I agree it is not a big thing at all, zero not returning any error. Yes! I read and understood the MAY return an error, it makes complete sense.
I agree, the Linux man pages need a lot of work, if they are going to be even close to reflecting some of things in the kernel.
Thanks,
Balbir
Quoted 49 lines · --- [email protected] wrote:
Quoted 1 line · Jim Hollenback
According to readv(2) EINVAL is returned for an
invalid
Quoted 1 line
argument.
Right.
Quoted 1 line
The examples given were count might be greater
than
Quoted 1 line
MAX_IOVECor zero.Wrong, or at least confusingly phrased.
In the good old days, a man page described what the system did,
and the ERRORS section gave the reasons for the possible error
returns.
These days a man page describes a function present on many
Unix-like systems, and not all systems have precisely the
same behaviour. POSIX man pages therefore distinguish under
ERRORS the two possibilities "if foo then this error must be
returned", and "if foo then this error may be returned".Linux man pages do not (yet) make this distinction - adding this is a lot of careful work, and so far nobody is doing this [hint..].
In other words, the ERRORS section in Linux man pages is
to be interpreted as "if foo then this error may be returned".Note that it may not be desirable at all to do things that way,
there is no need for kernel patches, it just means that systems
exist with this behaviour, so that authors of portable programs
must take this into account.Balbir Singh wrote:
Quoted 7 lines
Quoted 1 line
Apply this trivial patch, if you want the required
behaviour
But the behaviour is not required.
Paul Larson makes the same mistake.Andries
__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/