java process exit_Java Process.exitValue()中值的含义是什么?
如果系統(tǒng)殺死你的應(yīng)用程序(就像分段錯(cuò)誤一樣),它會(huì)將退出代碼設(shè)置為128 SIGNAL – 請(qǐng)參閱linux signal(7) manpage獲取信號(hào)值.
另外,對(duì)于linux,sysexits.h頭文件中定義了幾個(gè)默認(rèn)退出代碼,建議程序員使用這些常量而不是手動(dòng)定義自己的值.從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 */
但是,使用它們不是強(qiáng)制性的,您可以自由使用任何您想要的值.
一般的答案是 – 如果你的應(yīng)用程序正常失敗(即它能夠處理完成執(zhí)行的錯(cuò)誤),那么它自己設(shè)置退出代碼.如果應(yīng)用程序被系統(tǒng)殺死,則系統(tǒng)會(huì)設(shè)置退出代碼.
總結(jié)
以上是生活随笔為你收集整理的java process exit_Java Process.exitValue()中值的含义是什么?的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 广电总局都做了哪些看上去是很愚蠢的决定?
- 下一篇: java 初始化系统参数_系统中参数的初