dymm@b.cs.wvu.wvnet.edu (David Dymm) (03/08/89)
I would like to write an interrupt handling mechanism in 'C' to work in the following way: 1) Set up the signal facility: signal (SIGALRM, alarm_handler) 2) Set the alarm: ualarm (100000, 0) <== This will send a signal after 100,0000 microseconds. 3) The interrupt handler "alarm_handler" is called with the signal mechanism when the alarm timer times out. Let's call "location A" the place where we were in the code when we were interrupted by the timer. When "alarm_handler" has finished its local processing, I do NOT want to return control back to where the interrupt occurred!!!! Instead, I want to "longjmp" to another function in the program. When that function has completed its work, I want to return to "location A". The question is: How do I return to "location A" ??? I have looked at the "sigstack" mechanism, and also at the definitions for "sigcontext" and "sigstack" in "signal.h". But I do not see how to put this all together to accomplish my task. The system saves the state of the process on the signal stack when "signal" causes control to jump to "alarm_handler". How do I get at that information AND more importantly, how do I use that information to accomplish my task. Any ideas??? David Dymm Software Engineer USMAIL: Bell Atlantic Knowledge Systems, 145 Fayette Street, Morgantown, WV 26505 PHONE: 304 291-9898 (8:30-4:30 EST) USENET: {allegra,bellcore, cadre,idis,psuvax1}!pitt!wvucsb!dymm INTERNET: dymm@b.cs.wvu.wvnet.edu