Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!brl-adm!brl-smoke!smoke!cottrell@NBS-VMS.ARPA From: cottrell@NBS-VMS.ARPA (COTTRELL, JAMES) Newsgroups: net.lang.c Subject: Fast Morals & No Exit Message-ID: <1407@brl-smoke.ARPA> Date: Fri, 28-Feb-86 14:12:45 EST Article-I.D.: brl-smok.1407 Posted: Fri Feb 28 14:12:45 1986 Date-Received: Mon, 3-Mar-86 00:33:53 EST Sender: news@brl-smoke.ARPA Lines: 28 /* >> is Me, > is Andrew Koenig > > 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@nbs */ ------