This is the mail archive of the
mailing list for the Cygwin project.
Re: File reading problem with -mno-cygwin
Andrew DeFaria wrote:
> One question remains however and that is why would it work in Cygwin
> but not in -mno-cygwin? My theory is that opening a file with "r"
> under Cygwin is equivalent to "rb".
Using the -mno-cygwin option directs the code to link
against MSVCRT.DLL, so Cygwin is bypassed completely.
If you examine the Microsoft C runtime source, you'll see that
they explicitly check for a CTRL-Z as an end-of-file marker
if a file is opened in text mode. I think this behavior, along with
the LF to CRLF conversions, is an extension that is done by
Microsoft if you're in text mode.
I don't believe the Cygwin runtime treats CTRL-Z as a special case,
which explains the difference.
The CTRL-Z as EOF was a leftover from CP/M, but got propgated
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html