cygwin fork()

Christopher Faylor
Fri Sep 1 18:00:00 GMT 2006

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)
>>#  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.


Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list