home *** CD-ROM | disk | FTP | other *** search
- From: John Quarterman (moderator) <std-unix-request@ut-sally>
- Topic: standardizing exit codes
- It's not quite the same as standardized error messages,
- but close 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
-
- ------------------------------
-
- Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
- Submissions-To: ut-sally!std-unix or std-unix@ut-sally.ARPA
- Comments-To: ut-sally!std-unix-request or std-unix-request@ut-sally.ARPA
- UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
- Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
-
- Volume-Number: Volume 1, Number 39
-
-