プロセス終了コードの有効範囲についてメモ。
POSIX規格(IEEE Std 1003.1-2008, 2016 Ed.)より一部引用。
If the new state is terminated:
2.13. Status Information
- The low-order 8 bits of the status argument that the process passed to
_Exit()
,_exit()
, orexit()
, or the low-order 8 bits of the value the process returned frommain()
Note that these 8 bits are part of the complete value that is used to set the si_status member of thesiginfo_t
structure provided bywaitid()
- Whether the process terminated due to the receipt of a signal that was not caught and, if so, the number of the signal that caused the termination of the process
関連URL