TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Paul Wankadia
from: Paul Edwards
date: 1996-09-30 23:23:56
subject: using ctrlbrk()

PW> Hi, all.  When I change the Ctrl-Break handler using ctrlbrk(), is there 
PW> any easy way of just getting the system to IGNORE the Ctrl-Break, rather 

I don't know about ctrl-break per se, but with a normal signal handler, all
you need to do is say SIG_IGN (see doco on "signal" function).

PW> than getting the handler to longjmp() back to wherever I was (which would 
PW> mean I would need a setjmp() every alternate line <:(  I know it
can be done 

And you don't have to do anything of this sort - the signal handler will
return to the place it was interrupted from!  Of course, you will need to
set a flag or something in the code, and be checking for an interruption,
if you want the signal handler to actually do something BESIDES ignoring
it.  What you sometimes see is the signal handler:

1. reinstating itself (otherwise 2 interrupts would terminate the program,
although 1 won't)

2. printing a message saying "interrupt ignored".  

BFN.  Paul.
@EOT:

---
* Origin: X (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.