Message-Id: <199707221533.LAA29265@delorie.com> From: Oberhumer Markus Subject: Exception problem with __dpmi_yield() To: djgpp-workers AT delorie DOT com (djgpp-workers) Date: Tue, 22 Jul 1997 17:28:52 +0200 (METDST) Return-Read-To: markus DOT oberhumer AT jk DOT uni-linz DOT ac DOT at Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk /* Subject: Exception problem with __dpmi_yield() When I interrupt the following program with Control-C in my Win95 DOS shell, I will get a protection error and my shell painfully dies (try a few times). You can avoid the crash by setting `__djgpp_hwint_flags |= 3;'. Looks like a subtle bug in the exception handler to me. Markus */ #include #include #include #include #include int main() { void (*sig)(int); sig = signal(SIGINT,SIG_IGN); while (!kbhit()) { #if 1 __dpmi_yield(); /* crashes */ #elif 1 usleep(1000*1000); /* crashes */ #else ((void)0); /* this won't crash */ #endif } signal(SIGINT,sig); return 0; }