X-Spam-Check-By: sourceware.org From: "Dave Korn" To: Subject: RE: readv() questions Date: Wed, 10 May 2006 12:56:05 +0100 Message-ID: <001001c67428$b8559c50$a501a8c0@CAM.ARTIMI.COM> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <20060510111919.GN18330@ns1.anodized.com> Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On 10 May 2006 12:19, clayne AT anodized DOT com wrote: > On Tue, May 09, 2006 at 10:11:35PM -0700, clayne AT anodized DOT com 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 good! cheers, DaveK -- Can't think of a witty .sigline today.... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/