Fast Morals & No Exit

COTTRELL, JAMES cottrell at NBS-VMS.ARPA
Sat Mar 1 05:12:45 AEST 1986


/* >> is Me, > is Andrew Koenig <ark at alice.uucp>
> > The point is that the VMS C implementation must map its exit codes into
> > what the operating system expects. When the programmer says `exit 0', he
> > means `I succeeded'. The exit() function must support this.
> 
> No way!  exit(n) means "terminate and send the number n back to the system."

Referring to the infamous `April 30 1985' ANSI C Draft (I geuss the NIC
doesn't have their copy online yet :-), Section D.10.4.2, last three 
lines, it says, "Finally, control is returned to the 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". Whew! Quoting that was worse than reading it.

I would be surprised if the standard has changed on this point.

The Point Is, if `successful termination' means rewinding all the
tapedrives, printing the American flag on the laser printer, or aborting
the space shuttle, when I say `exit(0)', THAT IS WHAT MUST HAPPEN!!!
As you well know, a function _exit(int status) exists to do just what 
you mention. On VMS, after cleanup, exit(int status) should call
_exit(!status) in order to conform. I want my scripts to work right!

You see, Doug, not everyone who disagrees with Andy is a turkey.

	jim		cottrell at nbs
*/
------



More information about the Comp.lang.c mailing list