X-Spam-Check-By: sourceware.org From: "Dave Korn" To: Subject: RE: cygwin fork() Date: Fri, 1 Sep 2006 18:57:10 +0100 Message-ID: <004b01c6cdf0$0c657a60$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: <20060901174713.GE30633@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 01 September 2006 18:47, clayne AT anodized DOT HIPPO wrote: > I found the real culprit, which I had also ifdef'd out because it looked > bogus and crufty: > > /* Return 1 if a seek on FD will succeed. */ > #ifndef __CYGWIN__ > # define fd_is_seekable(fd) (lseek ((fd), 0L, SEEK_CUR) >= 0) > #else > # define fd_is_seekable(fd) 0 > #endif /* __CYGWIN__ */ Yeeesh. This is a terrible way of dealing with the fact that you can't seek a stream accurately if you open it in text mode, because of the ambiguity about whether you've advanced one or two chars through the underlying file when you see an LF that could perhaps have actually been a CR/LF. What we really want is #define fd_is_seekable(fd) fd_is_in_binary_not_text_mode(fd) ...although of course I'm paraphrasing there. Anyway, congratulations, well tracked down! Definitely one to raise with upstream... 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/