This is the mail archive of the cygwin 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: readv() questions

On 10 May 2006 12:19, wrote:

> On Tue, May 09, 2006 at 10:11:35PM -0700, wrote:
>> So far so good, but if anyone sees anything glaring might as well point it
>> out - although this is not really CW related at this point.
>> -cl
> Just to follow up on this.. I did take your advice fully Dave, and decided
> to just modify the partial iovec in place and restore a copy of it after
> handling the partial situation. 

  And there was I thinking "Oh, using a single read() call to get the partial
iovec and then a readv() call with an unmodified array but not starting at
entry [0] sounds like quite a neat way to deal with it"!

> I think we can rest assured race conditions are out of the picture. My
> code was the culprit, cygwin's was not :).
> In case anyone needs the code for any purpose (I know that I searched usenet
> and web quite a bit looking for any references to short|trunc|partial, etc.
> WRT readv()/writev() and found very little, so this may come in handy to
> others.

  Heh.  Everyone knows /in theory/ that read can return a partial result...
but there's a big gulf between having a bit of knowledge in the back of your
mind and actually following through all the possible implications and
complications that result.  You aren't the first to run into this kind of
problem and you won't be the last but you've got it sorted now and that's all

Can't think of a witty .sigline today....

Unsubscribe info:
Problem reports:

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