This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Base readv/writev patch


"Christopher Faylor" <cgf@redhat.com> wrote:
> On Fri, Aug 30, 2002 at 11:12:32AM -0400, Christopher Faylor
wrote:
> >On Fri, Aug 30, 2002 at 10:51:27AM -0400, Christopher Faylor
wrote:
> >>On Fri, Aug 30, 2002 at 03:11:28PM +0200, Corinna Vinschen
wrote:
> >>>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
in
> >>>> yesterday, i.e. just the generic syscall.cc and
fhandler_base
> >>>> parts, w/o any of the socket changes.  Otherwise unchanged
from
> >>>> before except for the expunging of those darn new-fangled
C++ cast
> >>>> woojits :-)
>
> I'll be checking this patch in.  I changed a couple of stylistic
things
> 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
complain.

> There does seem to be an issue with zero byte reads, though.
IIRC, you
> 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
this is
> consistent with SUSv3.  It seems to be consistent with linux, at
least.

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.

Thanks.

// Conrad




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]