🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3363

Re: EXIT_FAILURE problem

#3363
From: Derick J.R. Qua-Gonzalez
Date: Fri, 11 Aug 1995 09:03
39 lines
2286 bytes
halasz@caip.rutgers.edu writes:

>In article <Ik_SXNiSMUE48zNeor@transarc.com>, Jim_Mann@transarc.com writes
>$$$ No, the standard does not insist any such thing, nor does it insist
>$$$ that an OS that uses some other success return other than 0 is wrong.
>$$$ What the standard says is that exit(0) indicates success. On systems
>$$$ like VMS, the runtime simply translates exit(0) into the necessary
>$$$ return value indicating success.

>What is this but to decree that 0 is success, whatevver the OS s custom is?

Yes, which is correct. Therefore, a C program that reports "exit(0)" is
portable to any OS, regardless of "whatevver [sic] the OS s [sic] custom
is." For instance:

     exit(int ret_code)
     {
        if (ret_code==0) ret_code=VMS_SUCCESS_CODE;

        /* do other stuff, then terminate */
     }


Best regards, 
DQG.

--
+-----------------------------------------------------------------------------+
| Derick R. Qua-Gonzalez                                           | ________ |
| Department of High Energy Physics, California State University   | \      / |
| dqua@dqua.EarthLink.Net                                          |  \    /  |
|        ``It is better to be hated for what one is,               |   \  /   |
|          than loved for what one is not.'' (A. Gide)             | G  \/ USA|
+------------------------------------------------------------------+----------+
| mQBNAy/qJJMAAAECANBCB543eTUkdG8Mqx6K2cm3WxCVtKY8ZbB9WY6A2Ne4dQi8 | PGP2.6.2 |
| xh7OxjHXP/eXp5BSbmVAihEGd7r+5g/yknko56kABRG0MERKUiBRdWEtR29uemFs |  Public  |
| ZXogPGRxdWFAUHJvbWV0aGV1cy5FYXJ0aGxpbmsuTmV0Pg==                 | KeyBlock |
| =70DW                                                            | 06.20.95 |
+------------------------------------------------------------------+----------+
Technical Details
Message-ID: <dqua.808131820@dqua>
Path: arc1-ca.pugleaf.net!nntp.earthlink.net!dqua!dqua
References: <jbundyDCw7uo.9sz@netcom.com> <danpop.807723059@rscernix> <Ik_SXNiSMUE48zNeor@transarc.com> <40escg$bud@caip.rutgers.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!nntp.earthlink.net!dqua!dqua
From: dqua@earthlink.net (Derick J.R. Qua-Gonzalez)
Newsgroups: comp.std.c,comp.lang.c
Subject: Re: EXIT_FAILURE problem
Date: 11 Aug 95 09:03:40 GMT
Organization: Earthlink Network, Inc.
Message-ID: <dqua.808131820@dqua>
References: <jbundyDCw7uo.9sz@netcom.com> <danpop.807723059@rscernix> <Ik_SXNiSMUE48zNeor@transarc.com> <40escg$bud@caip.rutgers.edu>
NNTP-Posting-Host: dqua.earthlink.net