POSIX requires that readv and writev return EINVAL when iovcnt == 0. Our own man pages document that condition as well.
However, we accept iovcnt == 0, do nothing, and return 0. That's not inherently unreasonable, but it's not POSIX-compliant. From inspection, OpenBSD and NetBSD do not have this bug, but DragonflyBSD does.
Created attachment 221435 [details]
return EINVAL from writev and friends if iovcnt = 0
Actually, on closer inspection POSIX says that writev "may fail", not "shall fail" if iovcnt is out of bounds. So I guess this isn't a bug after all.