home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / c / 18445 < prev    next >
Encoding:
Text File  |  1992-12-16  |  1.5 KB  |  42 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!munnari.oz.au!bruce.cs.monash.edu.au!monu6!yoyo.cc.monash.edu.au!alien
  3. From: alien@yoyo.cc.monash.edu.au (Diego Barros)
  4. Subject: Signal() function & CTRL-C checking...
  5. Message-ID: <1992Dec16.053939.1014@monu6.cc.monash.edu.au>
  6. Sender: news@monu6.cc.monash.edu.au (Usenet system)
  7. Organization: Monash University General Access Unix
  8. X-Newsreader: TIN [version 1.1 PL8]
  9. Date: Wed, 16 Dec 1992 05:39:39 GMT
  10. Lines: 30
  11.  
  12. I have a quesiton concerning the signal function and how it is used. I'm
  13. trying to set up a routine which is called when anyone of 4 interrupts
  14. occur. When one of them does occur then a single function is called
  15. which will clean up and exit the program. The main reason is to detect
  16. when the user presses CTRL-C to break program execution.
  17.  
  18. Could someone please explain what exactly the signal prototype in the
  19. signal.h file is declaring (in english?!?) :) As knowing what the
  20. function is declared as would of course help my understanding as to how
  21. to use the function call.  
  22.  
  23. <signal.h>    extern void (*signal(int __sig, (*__func)(int)))(int);
  24.  
  25. And how should I declare the function which is called when one of the 4
  26. interrupts occur, what's its prototype? And how is signal called
  27. exactly?
  28.  
  29. Any help, and short C source examples showing the outline and procedures
  30. to do this would be greatly appreciated. 
  31.  
  32.  
  33. Thanks in advance...
  34. Cheers... :) 
  35.  
  36.  
  37. -- 
  38.             -------------------------
  39.           -----------------
  40.    _____     : Mmmmm Donuts... :     Diego Barros - Alien
  41.   /     \    o ----------------   Mail : alien@yoyo.cc.monash.edu.au
  42.