Article View: mod.std.unix
Article #123Re: standardized error messages
From: John Quarterman
Date: Sun, 21 Jul 1985 18:04
Date: Sun, 21 Jul 1985 18:04
33 lines
2371 bytes
2371 bytes
se enough to keep in the same discussion. ---------------------------------------------------------------------- Date: Sat, 20 Jul 85 16:52:04 PDT From: seismo!sun!guy (Guy Harris) To: ut-sally!std-unix Subject: Standardizing exit codes There is currently no universal standard for the meaning of exit codes, except that 0 means "true" or "success" and non-zero means "false" or "failure". Some System V programs use 2 for syntax errors, failure to open files, and the like, and 1 for "the command was run properly but gives a result of 'false'". "delivermail" and "sendmail" expect programs they run to exit with an error code from the include file <sysexits.h> which has a number of exit codes which further break down "failure to execute properly" (like exit code 2 in those System V commands) into "incorrect usage", "input data incorrect", "input file could not be opened", etc.. It might be useful to adopt some convention like that of <sysexits.h>. Exit code 0 would mean "the command executed without problems and returns a 'true' result; exit codes from 1 to some number N1 - 1 would mean "the command executed without problems and returns a 'false' result" - the exit code could be used to further specify the type of "false" result, if desired; exit codes from N1 to 254 could mean "the command did not execute successfully" and the exit codes from <sysexits.h> could break this down further; and exit code 255 would be reserved for forked-off child processes which were supposed to "exec" something but the "exec" failed. (In <sysexits.h>, N1 has the value 64.) Guy Harris ------------------------------
Technical Details
Message-ID:
<2423@ut-sally.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!decvax!genrad!mit-eddie!think!harvard!seismo!ut-sally!jsqReferences:
<2391@ut-sally.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ut-sally.UUCP Path: arc1-ca.pugleaf.net!utzoo!decvax!genrad!mit-eddie!think!harvard!seismo!ut-sally!jsq From: jsq@ut-sally.UUCP (John Quarterman) Newsgroups: mod.std.unix Subject: Re: standardized error messages Message-ID: <2423@ut-sally.UUCP> Date: Sun, 21-Jul-85 14:04:51 EDT Article-I.D.: ut-sally.2423 Posted: Sun Jul 21 14:04:51 1985 Date-Received: Mon, 22-Jul-85 15:13:12 EDT References: <2391@ut-sally.UUCP> Reply-To: std-unix@ut-sally.UUCP Organization: U. Texas CS Dept., Austin, Texas Lines: 36 Approved: jsq@ut-sally.UUCP Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.