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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,14aa27db81ce3b40 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newspeer.monmouth.com!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: How to exit an Ada program with (unix shell) error code? Date: Mon, 04 May 2009 09:42:50 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <49ba30c9-a1e6-4346-8618-d256f87ac301@s31g2000vbp.googlegroups.com> <87ws8xkz0y.fsf@willow.rfc1149.net> <95866b61-f7e4-482d-8368-8b86528af578@b1g2000vbc.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1241444571 7155 192.74.137.71 (4 May 2009 13:42:51 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 4 May 2009 13:42:51 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:2CnAPChZgC4B0EUxVi3tIoUHKuU= Xref: g2news2.google.com comp.lang.ada:5681 Date: 2009-05-04T09:42:50-04:00 List-Id: reinkor writes: > Thanks, but how I terminate the program in a "natural" way > (without using goto or "raise exception") ? You can call OS_Exit or OS_Abort in GNAT.OS_Lib. Look at the comments to see misc subtle issues. Or you can use pragma Import to interface directly to the OS exit routine, if you're on an OS that has such (most do). Or you can raise an exception, handle it at the bottom of the main procedure, and then just drop off the end. But you need to make sure any tasks will terminate -- the main procedure will wait for that, and if they never terminate, it will wait forever. Or you can abort the environment task. - Bob