Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site decvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!minow From: minow@decvax.UUCP (Martin Minow) Newsgroups: net.lang.c Subject: exit() on vms, one more time Message-ID: <183@decvax.UUCP> Date: Wed, 19-Feb-86 20:19:36 EST Article-I.D.: decvax.183 Posted: Wed Feb 19 20:19:36 1986 Date-Received: Fri, 21-Feb-86 04:48:19 EST References: <1015@brl-smoke.ARPA> Reply-To: minow@decvax.UUCP (Martin minow) Organization: DEC - ULTRIX Engineering Group Lines: 43 First, for the record, I have no connection with the Ultrix or Vax C groups (I work on DECtalk) and am offering only my own opinions. In a previous note, I pointed out that the Vax C developers used exit() to return a VMS system status code to the parent process. Several people suggested that this is incorrect, and doesn't conform to the Draft Standard. The Vax C development predates the Draft Standard by about 5 years. Decus C, which also made the same "mistake", was first publicly distributed in 1978, so it, too, predates the Draft Standard's implementation by a number of years. I would imagine that the Vax C developers used Kernighan and Ritchie for their language reference, and the Unix V6 manuals for the library. The description of exit is quite explicit: Exit closes all the process's files and notifies the parent process if it is exeucting a wait. The low byte of r0 (resp. the argument to exit) is available as status to the parent process. The manual page dates from 1973. Whether exit() will change is not for me to say. One possible solution would be, say, exit(code) { switch (code) { case 0: code = SS$_NORMAL; break; case 1: code = SS$_ABORT; break; } _exit(code); } Exit codes provide an example where existing practice differs on different operating systems. The Draft Standard may change before it is approved, and existing programs may have to change to conform to the standard, once adapted. Martin Minow decvax!minow