home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.ibm.pc.misc
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watserv1!sunee.uwaterloo.ca!rtang
- From: rtang@sunee.uwaterloo.ca (The One Your Mother Warned You About!)
- Subject: WatcomC and signal catches
- Message-ID: <Bt7tEJ.Iu3@watserv1.uwaterloo.ca>
- Sender: news@watserv1.uwaterloo.ca
- Organization: University of Waterloo
- References: <1992Aug19.042249.10838@sarah.albany.edu>
- Date: Wed, 19 Aug 1992 05:18:18 GMT
- Lines: 40
-
- Hope this is where this is supposed to go.
- Anyways,
- Has anyone out there used WATCOM C 386 compiler with DOS
- extender? I am having some trouble with the signal()
- function. It doesnt seem to do what its supposed to.
-
- In my code I have:
-
- #include <signal.h>
- #include <stdio.h>
- main()
- {
- for (;1==1;) {
- signal(SIGINT,myhandler);
- }
- }
-
- void
- myhandler(void)
- {
- printf("Control C pressed\n");
-
- }
-
- This is not the actual program I have, but has all the parts the
- deal with the problem. Actually, in the handler, I have a longjmp
- back into the main, which runs other code. But the problem
- is that thesignal catch isnt working at all, and control-C
- breaks out of the program still.
-
- Is there a setting I have to do in compiling or linking to
- let Watcom C know about the signal catch? or some environment
- variable?? I've actually typed in an example in the manual
- and that doesnt work either. So what am I doing wrong?
-
- Please email me direct if you have any ideas.
- Thanks,
-
-
- RAY
-