X-Spam-Check-By: sourceware.org
Date: Fri, 1 Sep 2006 14:00:41 -0400
From: Christopher Faylor <cgf-no-personal-reply-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: cygwin fork()
Message-ID: <20060901180041.GA11672@trixie.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <20060901174713.GE30633@ns1.anodized.com> <004b01c6cdf0$0c657a60$a501a8c0@CAM.ARTIMI.COM>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <004b01c6cdf0$0c657a60$a501a8c0@CAM.ARTIMI.COM>
User-Agent: Mutt/1.5.11
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Fri, Sep 01, 2006 at 06:57:10PM +0100, Dave Korn wrote:
>On 01 September 2006 18:47, clayne@anodized.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

AFAIK, Cygwin's lseek should handle seeking on text streams.  DJ
implemented that years ago.

cgf

--
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/

