home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / mod.std.unix.v1 / text0038.txt < prev    next >
Encoding:
Internet Message Format  |  1987-06-30  |  2.1 KB

  1. From: John Quarterman (moderator) <std-unix-request@ut-sally>
  2. Topic: standardizing exit codes
  3.     It's not quite the same as standardized error messages,
  4.     but close enough to keep in the same discussion.
  5.  
  6. ----------------------------------------------------------------------
  7.  
  8. Date: Sat, 20 Jul 85 16:52:04 PDT
  9. From: seismo!sun!guy (Guy Harris)
  10. To: ut-sally!std-unix
  11. Subject: Standardizing exit codes
  12.  
  13. There is currently no universal standard for the meaning of exit codes,
  14. except that 0 means "true" or "success" and non-zero means "false" or
  15. "failure".  Some System V programs use 2 for syntax errors, failure to open
  16. files, and the like, and 1 for "the command was run properly but gives a
  17. result of 'false'".  "delivermail" and "sendmail" expect programs they run
  18. to exit with an error code from the include file <sysexits.h> which has a
  19. number of exit codes which further break down "failure to execute properly"
  20. (like exit code 2 in those System V commands) into "incorrect usage", "input
  21. data incorrect", "input file could not be opened", etc..
  22.  
  23. It might be useful to adopt some convention like that of <sysexits.h>.  Exit
  24. code 0 would mean "the command executed without problems and returns a
  25. 'true' result; exit codes from 1 to some number N1 - 1 would mean "the
  26. command executed without problems and returns a 'false' result" - the exit
  27. code could be used to further specify the type of "false" result, if
  28. desired; exit codes from N1 to 254 could mean "the command did not execute
  29. successfully" and the exit codes from <sysexits.h> could break this down
  30. further; and exit code 255 would be reserved for forked-off child processes
  31. which were supposed to "exec" something but the "exec" failed.  (In
  32. <sysexits.h>, N1 has the value 64.)
  33.  
  34.     Guy Harris
  35.  
  36. ------------------------------
  37.  
  38. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  39. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  40. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  41. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  42. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  43.  
  44. Volume-Number: Volume 1, Number 39
  45.  
  46.