TURBO C: signal(SIGINT, ) works only for 1 Ctrl-Break?

John D. Mitchell johnm at cory.Berkeley.EDU
Tue Jan 1 12:14:13 AEST 1991


n article <15794.277f7a95 at levels.sait.edu.au> marwk at levels.sait.edu.au writes:
>In the TURBO C 2.0 reference manual on page 346 thre is an example of using
>signal() to divert the CTRL-BREAK exception to a user-defined routine.
>I entered the following code and it works the first time that ^Break is
>pressed, but then the program aborts the next time I press ^Break again.
>Does the signal get used up each time it is used?
[code example deleted]

Yep.  TC follows the SystemV style signal behavior.  Therefore you
need to call signal again in the handler function to handle multiple
signals.  I prefer the BSD-like behavior.



Good luck,
	John D. Mitchell
	johnm at cory.Berkeley.EDU



More information about the Comp.lang.c mailing list