Mail Archives: djgpp/1997/02/25/16:01:45
I've encountered very strange something.
After compiling enclosed below code with:
gcc -o foo foo.c
program hangs in function exit() ("Hello!" is printed).
Function flushKeyboard is guilty but I don't know why.
The more strange thing is that program hangs only if
the name of the coff file is three characters long.
If I rename "foo" for e.g. "foo1" and run "go32 foo1"
everything is O.K.
I found also that if I remove line:
SHELL=C:\COMMAND.COM C:\ /E:2000 /P
from my config.sys file program works fine.
I use gcc version 2.6.3 and go32 version 1.12 maint4
and work on DOS 7.0 (Windows 95 MS-DOS mode).
In WINDOWS MS-DOS BOX it works always fine.
Can anyone explain what happens?
Is there any other way to empty keyboard buffer?
#include <stdio.h>
#include <dpmi.h>
void main()
{
int c;
void flushKeyboard(void);
c=getch();
flushKeyboard();
printf("Hello!");
exit(0);
}
void flushKeyboard()
{
_go32_dpmi_registers r;
r.h.ah=0x0c;
r.h.al=0;
_go32_dpmi_simulate_int(0x21,&r);
}
----------------------
Tom Chojnacki
s709 AT icslab DOT agh DOT edu DOT pl
----------------------
- Raw text -