Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: exit(-1), 0 is sometimes magic Message-ID: <7162@brl-smoke.ARPA> Date: 22 Jan 88 20:32:35 GMT References: <502@cresswell.quintus.UUCP> <6935@brl-smoke.ARPA> <1179@wjvax.UUCP> <2305@bloom-beacon.MIT.EDU> <1234@nmtsun.nmt.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 16 Keywords: exit, zero In article <1234@nmtsun.nmt.edu> hydrovax@nmtsun.nmt.edu (M. Warner Losh) writes: >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. Note that only the low-order 8 bits of the exit status are significant on UNIX. Therefore, adding any multiple of 256 would have no effect (but don't do this, please!). 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.