home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / os2 / programm / 8111 < prev    next >
Encoding:
Text File  |  1993-01-29  |  1.7 KB  |  48 lines

  1. Newsgroups: comp.os.os2.programmer
  2. 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
  3. From: tommy@msc.cornell.edu (Mike Thompson)
  4. Subject: signal bug in CSET/2 1.0 w/ CS0028
  5. Message-ID: <1993Jan28.165724.28454@msc.cornell.edu>
  6. Sender: news@msc.cornell.edu
  7. Organization: Cornell-Materials-Science-Center
  8. Date: Thu, 28 Jan 1993 16:57:24 GMT
  9. Lines: 37
  10.  
  11. Hopefully this will get to the appropriate groups in IBM.  Any
  12. suggested workarounds would be appreciated.  I normally trap ^C to
  13. switch operating modes - don't really want the process crashing.
  14.  
  15. /* ---------------------------------------------------------------------------
  16. -- The following program illustrates a problem in the getch() routine.
  17. -- It seems that signals are caught by getch() and not passed on to the
  18. -- real handlers.  getch() subsequently crashes with a SYS3171 error 
  19. -- when the next character is typed.
  20. --
  21. -- Demonstrating the problem:
  22. --
  23. -- Press any # of characters, and then attempt a <CTRL><BREAK>, a <CTRL>C,
  24. -- a SIGTERM (via KILL), or any other condition.  The condition will not
  25. -- be accepted - but program will halt with a SYS3171 error on next char.
  26. --
  27. -- Compile command: icc -W3 -Sm test.c
  28. --
  29. -- System: C Set/2 compiler w/ CSD's 0014, 0022 and 0028.  All failed.
  30. --         OS/2 2.0 w/ XR06055 installed or 2.1b
  31. --------------------------------------------------------------------------- */
  32. #include <stdio.h>
  33. #include <conio.h>
  34.  
  35. int main(void) {
  36.     int achr;
  37.  
  38.     while ( (achr = getch()) != 'z')
  39.         printf("Character pressed: %i\n", achr);
  40.     return(0);
  41. }
  42.  
  43. -- 
  44. Michael O. Thompson            tommy@msc.cornell.edu
  45. Cornell University             (607) 255-4714
  46.  
  47. OS/2:  For the few, the proud, the devoted!
  48.