🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5812

Re: exit codes (was: Identifier length?)

#5812
From: Rahul Dhesi
Date: Wed, 22 Mar 1989 13:47
20 lines
1604 bytes
In article <9902@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>)
writes (responding to my article in which I say most existing C programs
exit with a code of 0, 1, or 2 and that 0=success, nonzero=failure is
a common convention):

>Not true.  Existing UNIX C programs that use exit codes as you describe
>will continue to work when the UNIX environment is upgraded to ANSI C
>standard conformance.  Existing C programs that rely on UNIX semantics
>for the exit codes are already nonportable, and the C standard reflects
>that fact (it doesn't *cause* it).

Scanning through C programming textbooks, which are geared towards a
variety of implementations not all under UNIX, we consistently find
exit(0) and exit(1) used for success and failure respectively.

It doesn't matter that these existing programs are "nonportable", if
that means (as it does in this case) "won't work under VAX/VMS".
-- 
Rahul Dhesi         UUCP:  <backbones>!{iuvax,pur-ee}!bsu-cs!dhesi
                    ARPA:  dhesi@bsu-cs.bsu.edu
Technical Details
Message-ID: <6272@bsu-cs.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!bsu-cs!dhesi
References: <627@maxim.ERBE.SE> <1989Mar16.171213.21210@utzoo.uucp> <6161@bsu-cs.UUCP> <1989Mar17.175939.1226@utzoo.uucp> <6212@bsu-cs.UUCP> <12111@haddock.ima.isc.com> <6268@bsu-cs.UUCP> <9902@smoke.BRL.MIL>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!bsu-cs!dhesi
From: dhesi@bsu-cs.UUCP (Rahul Dhesi)
Newsgroups: comp.std.c
Subject: Re: exit codes (was: Identifier length?)
Message-ID: <6272@bsu-cs.UUCP>
Date: 22 Mar 89 13:47:54 GMT
References: <627@maxim.ERBE.SE> <1989Mar16.171213.21210@utzoo.uucp> <6161@bsu-cs.UUCP> <1989Mar17.175939.1226@utzoo.uucp> <6212@bsu-cs.UUCP> <12111@haddock.ima.isc.com> <6268@bsu-cs.UUCP> <9902@smoke.BRL.MIL>
Reply-To: dhesi@bsu-cs.UUCP (Rahul Dhesi)
Organization: CS Dept, Ball St U, Muncie, Indiana
Lines: 20