Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!PAVEPAWS.BERKELEY.EDU!dillon From: dillon@PAVEPAWS.BERKELEY.EDU (Matt Dillon) Newsgroups: net.micro.amiga Subject: SIGBREAKF_CTRL_C, exception handling Q's Message-ID: <8605110442.AA09714@pavepaws> Date: Sun, 11-May-86 00:42:27 EDT Article-I.D.: pavepaws.8605110442.AA09714 Posted: Sun May 11 00:42:27 1986 Date-Received: Tue, 13-May-86 00:43:36 EDT Sender: daemon@ucbvax.BERKELEY.EDU Organization: University of California at Berkeley Lines: 60 I am currently attempting to impliment Ctl-C in my shell, and am having some problems with exception handling. (Please do not tell me to use the provided break-checking routines, they do not do enough) The problem is, there are exactly 3 pages in all my manuals which describe exception handling. * I get my task structure w/ FindTask(NULL); * I clear signals with SetSignal(0L, SIGBREAKF_CTRL_C) * I set task->tc_ExceptCode to my exception handler. * I turn on exception processing w/ SetExcept(SIGBREAKF_CTRL_C,SIGBREAKF_CTRL_C) my exception handling routine is: exception() { ++some_global_variable; return (SIGBREAKF_CTRL_C); } (A) When I SetExcept(), I IMMEDIATELY get an exception. Why? there are no pending signals because I cleared the signal mask. (B) Several things are unclear What should exception() return in D0? The manual says something like 'return what was in D0 originally, which is a mask of the exceptions which have occured'. It isn't explicit enough. The Manual says that it pushes all the registers et all... so I don't have to (thus I used a C exception handler). right? Can I longjump() out of the exception handler? Who clears the signal flag and when? Who clears the exception flag and when? (C) There seems to be a problem The exception mask contains bits set (before I change anything) sometimes, other times there is nothing. The ExceptCode vector already contains something... FC2A98. What does this routine do (since I'm basically overiding it)? ----------------------------- Also, I want to be able to pass a Ctl-C signal on to commands currently being executed. How does CLI do this? Thanks, -Matt