home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!munnari.oz.au!bruce.cs.monash.edu.au!monu6!yoyo.cc.monash.edu.au!alien
- From: alien@yoyo.cc.monash.edu.au (Diego Barros)
- Subject: Signal() function & CTRL-C checking...
- Message-ID: <1992Dec16.053939.1014@monu6.cc.monash.edu.au>
- Sender: news@monu6.cc.monash.edu.au (Usenet system)
- Organization: Monash University General Access Unix
- X-Newsreader: TIN [version 1.1 PL8]
- Date: Wed, 16 Dec 1992 05:39:39 GMT
- Lines: 30
-
- I have a quesiton concerning the signal function and how it is used. I'm
- trying to set up a routine which is called when anyone of 4 interrupts
- occur. When one of them does occur then a single function is called
- which will clean up and exit the program. The main reason is to detect
- when the user presses CTRL-C to break program execution.
-
- Could someone please explain what exactly the signal prototype in the
- signal.h file is declaring (in english?!?) :) As knowing what the
- function is declared as would of course help my understanding as to how
- to use the function call.
-
- <signal.h> extern void (*signal(int __sig, (*__func)(int)))(int);
-
- And how should I declare the function which is called when one of the 4
- interrupts occur, what's its prototype? And how is signal called
- exactly?
-
- Any help, and short C source examples showing the outline and procedures
- to do this would be greatly appreciated.
-
-
- Thanks in advance...
- Cheers... :)
-
-
- --
- -------------------------
- -----------------
- _____ : Mmmmm Donuts... : Diego Barros - Alien
- / \ o ---------------- Mail : alien@yoyo.cc.monash.edu.au
-