Date: Thu, 16 Sep 1999 13:17:42 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: IBEC23 AT cc DOT uab DOT es cc: djgpp AT delorie DOT com Subject: Re: Some problems with "keyboard returns" under NT 4.0 In-Reply-To: <01JG0F8ZXLIQ007OLE@cc.uab.es> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 15 Sep 1999 IBEC23 AT cc DOT uab DOT es wrote: > Here the description of the problem (providing you state > int _crt0_startup_flags=_CRT0_FLAG_UNIX_SBRK outside any > function body): > > "In some circumstancies, a fast keyboard return after a > getch() causes the program to abruptily terminate and to > return to the DOS prompt; neverteless, if the key is > pressed slowly, no problem occurs and the program continues." Confirmed. Weird; I'm almost led to believe that this is ome NT bug: if the program exits too fast, its output is thrown away (???). > Due to the continuous improvement of DJGPP, we have supposed > that the old problem (1997) dissapeared in the meantime. And > again yes: the old problem described at the beginning of > this message seems not to appear although not stating: > int _crt0_startup_flags = _CRT0_FLAG_UNIX_SBRK; Did you change the DJGPP version in between? In other words, what DJGPP version did you use then, and which version do you use now? > - Was the problem with system() and malloc(), printf(), etc > in NT really solved? Or simply we have not fount it yet, after > removing int _crt0_startup_flags = _CRT0_FLAG_UNIX_SBRK. I don't think that any of the reasons that cause the Unixy sbrk to be better suited for NT were removed in the last DJGPP release. malloc was rewritten, but I don't think the changes matter on NT, but that's about all I can remember. > Unfortunately, we do not have enough knowledge of low level > programming for undestanding the meaning of the > _crt0_startup_flags and how it can interact with getch() > and malloc() causing the program to stop after a fast > return keystroke. The Unixy sbrk algorithm changes the way DJGPP allocates memory from the DPMI server. In particular, the Unixy algorithm causes the memory used by the application to be contiguous. The default sbrk algorithm can sometimes result in memory being allocated in several non-contiguous chunks.