home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.os2.programmer
- Path: sparky!uunet!math.fu-berlin.de!ira.uka.de!scsing.switch.ch!univ-lyon1.fr!ghost.dsi.unimi.it!batcomputer!lynx@msc.cornell.edu!tommy
- From: tommy@msc.cornell.edu (Mike Thompson)
- Subject: signal bug in CSET/2 1.0 w/ CS0028
- Message-ID: <1993Jan28.165724.28454@msc.cornell.edu>
- Sender: news@msc.cornell.edu
- Organization: Cornell-Materials-Science-Center
- Date: Thu, 28 Jan 1993 16:57:24 GMT
- Lines: 37
-
- 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!
-