Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbosgd!gatech!seismo!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: net.lang.c Subject: Re: exit() on VMS Message-ID: <984@brl-smoke.ARPA> Date: Sun, 16-Feb-86 02:26:44 EST Article-I.D.: brl-smok.984 Posted: Sun Feb 16 02:26:44 1986 Date-Received: Tue, 18-Feb-86 04:23:15 EST References: <1046@decwrl.DEC.COM> <3174@umcp-cs.UUCP> <178@decvax.UUCP> Reply-To: gwyn@brl.ARPA Organization: /usr/local/lib/news/organization Lines: 25 In article <178@decvax.UUCP> minow@decvax.UUCP (Martin minow) writes: > > Unfortunately, on VMS, status code 1 means "success", thus the > Unix exit(1) usage to indicate errors fails. Therefore VMS has incorrectly implemented the exit() function. Early Whitesmiths C systems tried to pull this switch, too. VMS could very easily correctly implement exit() using something like: void exit( status ) /* agrees with the rest of the world */ { extern void _vms_exit(); /* previously named "exit" */ _vms_exit( !status ); } I get the impression that VMS C was implemented by people who did not have much practical experience with C programming. The fact is, correctly-written C applications from non-VMS systems are most unlikely to be coded as you suggested "for portability"; they invariably return a hard-wired 0 status to indicate success. Quoting from X3J11 section D.10.4.2: "Finally, control is returned to the host environment. If the value of `status' is zero, the status returned is *successful termination*; otherwise an implementation- defined form of the status *unsuccessful termination* is returned.