From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1ffdab534421bb89 X-Google-Attributes: gid103376,public From: Geert Bosch Subject: Re: How to bypass CTRL-C? Date: 1999/01/28 Message-ID: <36B06372.FC9841EC@amazone.gnat.com>#1/1 X-Deja-AN: 437924799 Content-Transfer-Encoding: 7bit References: <36AF61EE.93C36E67@videotron.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: WinStar NorthWest Nexus Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-01-28T00:00:00+00:00 List-Id: This issue is partly compiler/platform specific. If you're using GNAT, be sure to browse the documentation and have a look at the "features" file for things new in GNAT 3.11p: | A new pragma Unreserve_All_Interrupts allows an implementation to | specify that normally reserved interrupts (e.g. SIGINT for handling | Ctrl-C) are to be unreserved, so that the application program may | handle these interrupts as it pleases. In your case this pragma alone would be enough, as you do not actually want to handle the interrupt but only want to prevent the system from handling it for you. So you do not have to install a handler, although you might want to do so for printing an error message (like "*** program cannot be interrupted ***") or to register the request and terminate as soon as possible. Note that the mechanisms to actually install handlers for interrupts is part of the language and support for interrupts is provided by all compilers implementing Annex C (Systems Programming). Regards, Geert