Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site rdin.UUCP Path: utzoo!linus!philabs!rdin!perl From: perl@rdin.UUCP (Robert Perlberg) Newsgroups: net.lang.c Subject: Re: Fast code and no morals (exit() on VMS) Message-ID: <533@rdin.UUCP> Date: Thu, 20-Feb-86 15:12:12 EST Article-I.D.: rdin.533 Posted: Thu Feb 20 15:12:12 1986 Date-Received: Mon, 24-Feb-86 07:23:54 EST References: <1015@brl-smoke.ARPA> Organization: Resource Dynamics Inc., New York Lines: 37 >I know this is naive, but then this flock is full of naive users... >Doug, where exactly do Kernighan & Ritchie specify the semantics of >the exit() procedure ? > > you can't say VMS is WRONG >just because it's DIFFERENT unless you can quote chapter and verse. > >Does the ANSI draft specify semantics for system calls ? K&R, Chapter 7, page 154, verse 5 (and I quote -- uh-hum): "The program also uses the standard library function exit, which terminates program execution when it is called. The argument of exit is available to whatever process called this one, so the success or failure of the program can be tested by another program that uses this one as a subprocess. By convention, a return value of 0 signals that all is well, and various non-zero values signal abnormal situations." Amen. Let's get real, though. I don't really care about how something is defined by K&R or ANSI or any so-called authority. All I care about is being able to copy a bunch of code onto a system, compile it, and have it work. If the designers of VAX C endowed it with an exit() function, it's not because they saw it in K&R, it's because they wanted VAX C to be able to compile and run the vast body of C code "out there". The VAX C manual is loaded with references to UNIX and has many functions which are clearly intended to mimic UNIX (take a look at stat()). You could quote K&R till doomsday and it wouldn't make existing code run on existing systems until you wake up and take a look at how things are done in the real world and adapt to it. You're a fine one to be calling others "naive". Robert Perlberg Resource Dynamics Inc. New York {philabs|delftcc}!rdin!perl