Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!beta!unm-la!unmvax!nmtsun!hydrovax From: hydrovax@nmtsun.nmt.edu (M. Warner Losh) Newsgroups: comp.lang.c Subject: Re: exit(-1), 0 is sometimes magic Summary: OK, I wasd wrong Keywords: exit, zero Message-ID: <1251@nmtsun.nmt.edu> Date: 23 Jan 88 19:05:15 GMT References: <502@cresswell.quintus.UUCP> <6935@brl-smoke.ARPA> <1179@wjvax.UUCP> <7162@brl-smoke.ARPA> Organization: NMT Hydrology program Lines: 32 In article <7162@brl-smoke.ARPA>, gwyn@brl-smoke.ARPA (Doug Gwyn ) writes: > In article <1234@nmtsun.nmt.edu> hydrovax@nmtsun.nmt.edu (I) write: > >As a side note. exit(0) in UNIX isn't quit correct. The UNIX shell, > >as far as I know, doesn't give a hill of beans wheather you say exit(0), > >exit(1000), exit (magic_number).... > > No, there are shell built-ins such as "test" that "know" that only a 0 > termination status indicates success. > A knee jerk reaction at best. Had I stopped to read the manuals..... > The point that the exit status is interpreted by the execution environment, > which is not necessarily synonymous with the "operating system", is correct. > Saying that this is a "shell" is being too specific, however. In fact, > even on UNIX it's not necessarily a shell, just the parent process. I know that picking nits like this can be irritating, but they should be pointed out from time to time. I just got a little carried away with the generalism. Programmers that complain about how this or that system does X should realize what part of the system is resonsible for the X behaviour. Otherwise, we might say that UNIX (or VMS) has lots of bugs in it, because some obscure utility core dumps (or produces a typical VMS error SCREEN :-). That utility is buggy, not the operating system in which it lives. -- bitnet: lush@nmt.csnet M. Warner Losh csnet: warner%hydrovax@nmtsun uucp: ...{cmcl2, ihnp4}!lanl!unmvax!nmtsun!warner%hydrovax ...{cmcl2, ihnp4}!lanl!unmvax!nmtsun!hydrovax Warning: Hydrovax is both a machine, and an account, so be careful.