Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!yale!leichter From: leichter@yale.UUCP (Jerry Leichter) Newsgroups: comp.lang.c Subject: Re: exit(-1) Keywords: exit, zero Message-ID: <21531@yale-celray.yale.UUCP> Date: 18 Jan 88 16:44:50 GMT References: <6935@brl-smoke.ARPA> <6983@brl-smoke.ARPA> <7208@ki4pv.uucp> <23160@cca.CCA.COM> <7097@brl-smoke.ARPA> <2306@bloom-beacon.MIT.EDU> <304@fig.bbn.com> <7121@brl-smoke.ARPA> Reply-To: leichter@yale-celray.UUCP (Jerry Leichter) Organization: Yale University Computer Science Dept, New Haven CT Lines: 30 In article <7121@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >In article <304@fig.bbn.com> rsalz@bbn.com (Rich Salz) writes: >>** SYSEXITS.H -- Exit status codes for system programs. > >Use this on UNIX systems if you wish; it is NOT suitable for use on some >other operating systems. On the other hand, the NAMES and their respective meanings would make sense on any operating system. If you are willing to (a) use only macros from SYSEXITS.H in calls to exit() or as values returned by main(); and (b) go through the fairly simple exercise of creating a SYSEXITS.H with values appropriate to a particular operating system you want to port to; then your code will be very portable (at least in this one respect). Of course, if SYSEXITS.H were to become standard - either part of an ANSI C standard, or a defacto standard - then (b) becomes unnecessary, since some- one will already have done the work. ...and THAT, of course, was the whole point. (I'm sure Doug understands this, but it might have gotten missed in his very brief response.) (It should be noted, though, that the list of errors was clearly chosen with a particular kind of program - a mailer - in mind. While some of them are more generally useful ("No permission"), others are rather specialized ("Protocol error"), and there are probably other, more generally-useful errors that would have to be included to create a truely useful, general- purpose "SYSEXITS" file.) -- Jerry