Path: utzoo!mnetor!uunet!husc6!purdue!umd5!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: Re: exit(-1) Message-ID: <10312@mimsy.UUCP> Date: 23 Jan 88 06:32:06 GMT References: <502@cresswell.quintus.UUCP> <6935@brl-smoke.ARPA> <1179@wjvax.UUCP> <1240@nmtsun.nmt.edu> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 33 >In article <10237@mimsy.UUCP> I claimed that (in a better world) >>Unix, by virtue of being the first system to implement the language, >>is privileged: it gets to take the argument to exit() and pass it >>back to the calling program. Other systems might have to convert >>the argument to 0 => success, anything else => unspecified failure. In article <1240@nmtsun.nmt.edu> hydrovax@nmtsun.nmt.edu (M. Warner Losh) writes: > The UNIX operating system does not work this way. The shells that >surround it DO. This is true, and entirely irrelevant. Since the shells that surround it assume that 0 => success, anything else => unspecified failure, `Unix' (whatever that is) assumes 0 => success, anything else => unspecified failure. While there are programs that do not follow this convention, they are in the minority (and, incidentally, they are being weeded out, at least in 4BSD: /etc/dump recently changed to exit(0) instead of exit(1) on success). In other words, all we have to do is take this convention and establish it as a standard across all systems (including Unix!---where it is implemented entirely outside of the kernel, but it *is* implemented), and *everything* *works*. We have gained portability and lost nothing. >The basic argument is this: Since UNIX had it first, should all other >OS's be forced to use that convention? Since portability is gained, and nothing is lost, *YES*. This is then a *language* convention, *not* an operating system convention. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris