Date: Mon, 1 Jan 2001 10:18:30 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Jean Michel cc: djgpp AT delorie DOT com Subject: Re: Bug in djgpp libc In-Reply-To: <92o411$em$1@schur.institut.math.jussieu.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 31 Dec 2000, Jean Michel wrote: > Hello, there is a bug in the djgpp libc library. It's not a bug in DJGPP. > { printf("\032\n"); > fprintf(stderr, "%s\n", strerror(errno)); > } > > produces > > No space left on drive (ENOSPC) That's because the DOS/Windows console driver returns EOF when you write the Ctrl-Z character to it in cooked mode. Ctrl-Z is a kind of ``software end-of-file'' marker in DOS. There's nothing DJGPP can do with that. > [For people who may wonder why one would want to do the above, this is > the end result of trying to find the smallest example which shows a bug > occuring in the djgpp port of the ruby interpreter] A program which really _needs_ to write a raw Ctrl-Z character to the screen, should switch the console device into raw mode, where the special meaning of characters such as Ctrl-Z, Ctrl-P, TAB, etc. is switched off. However, since this issue is tricky, I'd suggest to post here an explanation of why does the ruby interpreter need to write a Ctrl-Z character to the screen. It's quite possible that switching the console into raw mode is not the right thing to do in that case, but it's hard to suggest a good solution without knowing the details.