🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5810

Re: exit codes (was: Identifier length?)

#5810
From: Rahul Dhesi
Date: Wed, 22 Mar 1989 03:56
18 lines
1425 bytes
In article <12111@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer)
writes [about my claim that 0=normal nonzero=error in exit(n)]:
>This is not common practice.  Even in Unix, the current situation is that
>(n%256==0) denotes normal exit, (n%256!=0) flags an error.

(The reference here is to the fact that only the lowest 8 bits of n
are used.)

Existing programs almost never use anything other than a return code of
0, 1, or 2.  It almost doesn't matter what the standard says about the
number of bits used.  In fact the standard could simply have said:
"...if the value of the exit code is not 0, 1, or 2, it is interpreted
in an implementation-dependent manner".  That would not affect more
than about 0.2% of existing C programs.  The current standard affects
all of them.
-- 
Rahul Dhesi         UUCP:  <backbones>!{iuvax,pur-ee}!bsu-cs!dhesi
                    ARPA:  dhesi@bsu-cs.bsu.edu
Technical Details
Message-ID: <6268@bsu-cs.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!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>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!iuvax!bsu-cs!dhesi
From: dhesi@bsu-cs.UUCP (Rahul Dhesi)
Newsgroups: comp.std.c
Subject: Re: exit codes (was: Identifier length?)
Message-ID: <6268@bsu-cs.UUCP>
Date: 22 Mar 89 03:56:52 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>
Reply-To: dhesi@bsu-cs.UUCP (Rahul Dhesi)
Organization: CS Dept, Ball St U, Muncie, Indiana
Lines: 18