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


> From: Dave Korn
> Sent: Friday, September 01, 2006 12:57 PM
> Subject: RE: cygwin fork()
> 
> On 01 September 2006 18:47, clayne 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...
> 

*sip*!

> 
> 
> 
>     cheers,
>       DaveK
> --
> Can't think of a witty .sigline today....
> 

-- 
Gary R. Van Sickle


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