Path: utzoo!utgpu!water!watmath!clyde!rutgers!gatech!bloom-beacon!athena.mit.edu!eichin From: eichin@athena.mit.edu (Mark W. Eichin) Newsgroups: comp.lang.c Subject: Re: exit(-1) Summary: exit => vms$exit Message-ID: <2359@bloom-beacon.MIT.EDU> Date: 19 Jan 88 04:57:18 GMT References: <502@cresswell.quintus.UUCP> <6935@brl-smoke.ARPA> <1179@wjvax.UUCP> <1185@wjvax.UUCP> <1225@nmtsun.nmt.edu> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: eichin@athena.mit.edu (Mark W. Eichin) Organization: Mental Inflection Tensors Lines: 49 This looks much too simple to me: In C: exit(ansi_status) int ansi_status; { int vms_status; switch(ansi_status) { case 0: vms_status = SS$EXIT; /* == 1 */ break; case 1: /* .... fill in other ANSI codes and there VMS equivalents .... */ default: vms_status = SS$WEIRD; /* you know what I mean... */ } vms_$exit(vms_status); /* getting out for real */ } In English: The ANSI values for arguments to exit() do NOT specify what the program must return to the operating system! They map status meanings to the >>>argument of exit()<<< which will then get shuffled off into the operating system as anything it wants... The question that should follow is "what about system() or exec()/wait(), what should they return?" Well, ANSI could probably specify that too, and any operating system that needed to do a mapping for exit() could just reverse the mapping... Thus, the arguments seem to result from the neglect of the idea that simple units specified by ANSI could have deeper implementations. Am I missing something dreadful here? [The details are fuzzy, my knowledge of the VMS problem derives solely from these postings... but this idea SEEMS sound.] Mark Eichin Mark Eichin SIPB Member & Project Athena ``Watchmaker''