This is the mail archive of the
mailing list for the Cygwin project.
Re: Base readv/writev patch
"Christopher Faylor" <email@example.com> wrote:
> On Fri, Aug 30, 2002 at 11:12:32AM -0400, Christopher Faylor
> >On Fri, Aug 30, 2002 at 10:51:27AM -0400, Christopher Faylor
> >>On Fri, Aug 30, 2002 at 03:11:28PM +0200, Corinna Vinschen
> >>>On Thu, Aug 29, 2002 at 01:06:14AM +0100, Conrad Scott wrote:
> >>>> Attached is the base part of the readv/writev patch I sent
> >>>> yesterday, i.e. just the generic syscall.cc and
> >>>> parts, w/o any of the socket changes. Otherwise unchanged
> >>>> before except for the expunging of those darn new-fangled
> >>>> woojits :-)
> I'll be checking this patch in. I changed a couple of stylistic
> for consistency with the rest of the code.
> Just as a hint, I really don't like this style of if test:
> if (!(foo == bar && blah != 0))
No problem: I do have trouble with negated conditions, e.g. (!x ||
!y), and I have to put them back into the form "it's not the case
that x && y" every time I read them, so we seem to differ here.
But I know it's not how they're usually written so I can't
> There does seem to be an issue with zero byte reads, though.
> are supposed to be able to do this:
> errno = 2;
> read (0, 0, 0)
> assert (errno == 2)
> i.e., a zero byte read does not check the buffer arguments.
> I modified check_iovec_for_* to do this, but I don't know if
> consistent with SUSv3. It seems to be consistent with linux, at
I'm very glad you caught that Chris, I'm obviously not firing on
all cylinders right now. It is certainly consistent w/ SUSv3
since readv(2) is defined to be just as per read(2) in such cases,
and an implementation is allowed to have calls such as read
(-1, -1, 0) succeed, i.e. if the length is zero no other error
checking is mandated. So, thanks for catching this one.
> I've checked this patch in.