java process exit_Java Process.exitValue()中值的含义是什么?
如果系統殺死你的應用程序(就像分段錯誤一樣),它會將退出代碼設置為128 SIGNAL – 請參閱linux signal(7) manpage獲取信號值.
另外,對于linux,sysexits.h頭文件中定義了幾個默認退出代碼,建議程序員使用這些常量而不是手動定義自己的值.從exit(3) manpage開始:
BSD has attempted to standardize exit codes; see the file .
您可以找到該文件,例如here,其中包含的值為:
#define EX_OK 0 /* successful termination */
#define EX__BASE 64 /* base value for error messages */
#define EX_USAGE 64 /* command line usage error */
#define EX_DATAERR 65 /* data format error */
#define EX_NOINPUT 66 /* cannot open input */
#define EX_NOUSER 67 /* addressee unknown */
#define EX_NOHOST 68 /* host name unknown */
#define EX_UNAVAILABLE 69 /* service unavailable */
#define EX_SOFTWARE 70 /* internal software error */
#define EX_OSERR 71 /* system error (e.g.,can't fork) */
#define EX_OSFILE 72 /* critical OS file missing */
#define EX_CANTCREAT 73 /* can't create (user) output file */
#define EX_IOERR 74 /* input/output error */
#define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */
#define EX_PROTOCOL 76 /* remote error in protocol */
#define EX_NOPERM 77 /* permission denied */
#define EX_CONFIG 78 /* configuration error */
#define EX__MAX 78 /* maximum listed value */
但是,使用它們不是強制性的,您可以自由使用任何您想要的值.
一般的答案是 – 如果你的應用程序正常失敗(即它能夠處理完成執行的錯誤),那么它自己設置退出代碼.如果應用程序被系統殺死,則系統會設置退出代碼.
總結
以上是生活随笔為你收集整理的java process exit_Java Process.exitValue()中值的含义是什么?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 广电总局都做了哪些看上去是很愚蠢的决定?
- 下一篇: 茶杯多少钱一只啊?