exit() on VMS

Doug Gwyn gwyn at brl-smoke.ARPA
Sun Feb 16 17:26:44 AEST 1986


In article <178 at decvax.UUCP> minow at 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.



More information about the Comp.lang.c mailing list