readv() return and errno
In doing some testing on the project I'm working on I came across something that is causing a bit of confusion on my part.
According to readv(2) EINVAL is returned for an invalid argument. The examples given were count might be greater than MAX_IOVEC or zero. The test case I am working with has count = 0 and I get return of 0 and errno 0 instead of the expected -1 and erron EINVAL.
Am I missing something?
Thanks!
Jim Hollenback
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jim Hollenback
Jim> In doing some testing on the project I'm working on I came Jim> across something that is causing a bit of confusion on my part.
Jim> According to readv(2) EINVAL is returned for an invalid Jim> argument. The examples given were count might be greater than
Jim> MAX_IOVEC or zero. The test case I am working with has count Jim> 0 and I get return of 0 and errno 0 instead of the expected -1
Jim> and erron EINVAL.
Jim> Am I missing something?
It seems like the man page is describing the behavior defined in Single UNIX spec:
[EINVAL] The iovcnt argument was less than or equal to 0, or greater
than {IOV_MAX
However, the kernel code clearly doesn't match this description (it returns no error for a zero-length iovec). You might want to bring this up on the linux-kernel list, as this is not ia64-specific behavior.
--david