TURBO C: signal(SIGINT, ); multiple calls hangs itself

marwk at levels.sait.edu.au marwk at levels.sait.edu.au
Wed Jan 2 02:08:04 AEST 1991


In article <9975 at pasteur.Berkeley.EDU>, johnm at cory.Berkeley.EDU (John D. Mitchell) writes:

> 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.
>
>
Thank you for this information.

If signal is called again in the handler function up to about 25 attempts
to Break the program are successfully thwarted, but then       , that's right,
nothing happens - a cold boot is required.

Is this to be expected, or should I replace the interrupt and forget about
signals for multiple 'entraption'?

Ray



More information about the Comp.lang.c mailing list