🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.os2.programmer
1 messages
1 total messages Started by Mike Thompson Thu, 28 Jan 1993 16:57
signal bug in CSET/2 1.0 w/ CS0028
#3724
Author: Mike Thompson
Date: Thu, 28 Jan 1993 16:57
37 lines
1818 bytes
Hopefully this will get to the appropriate groups in IBM.  Any
suggested workarounds would be appreciated.  I normally trap ^C to
switch operating modes - don't really want the process crashing.

/* ---------------------------------------------------------------------------
-- The following program illustrates a problem in the getch() routine.
-- It seems that signals are caught by getch() and not passed on to the
-- real handlers.  getch() subsequently crashes with a SYS3171 error 
-- when the next character is typed.
--
-- Demonstrating the problem:
--
-- Press any # of characters, and then attempt a <CTRL><BREAK>, a <CTRL>C,
-- a SIGTERM (via KILL), or any other condition.  The condition will not
-- be accepted - but program will halt with a SYS3171 error on next char.
--
-- Compile command: icc -W3 -Sm test.c
--
-- System: C Set/2 compiler w/ CSD's 0014, 0022 and 0028.  All failed.
--         OS/2 2.0 w/ XR06055 installed or 2.1b
--------------------------------------------------------------------------- */
#include <stdio.h>
#include <conio.h>

int main(void) {
	int achr;

	while ( (achr = getch()) != 'z')
		printf("Character pressed: %i\n", achr);
	return(0);
}

-- 
Michael O. Thompson            tommy@msc.cornell.edu
Cornell University             (607) 255-4714

OS/2:  For the few, the proud, the devoted!
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads