The relevant system call is _exit(), and POSIX itself specifies that only the bottom 8 bits of the status given to _exit() are normally usable: _exit(状态) 状态值可以是 0 , EXIT_SUCCESS , EXIT_FAILURE 或任何其他值,尽管只有最低有效8位(即 status& 0377 )应可从 wait()和 waitpid()获得; _exit(status) The value of status may be 0, EXIT_SUCCESS, EXIT_FAILURE, or any other value, though only the least significant 8 bits (that is, status & 0377) shall be available from wait() and waitpid();尽管继续说应该从 waitid()中获得全部值",但是在Linux上,我似乎仍然只得到低8位.Though it goes on to say that "the full value shall be available from waitid()", but on Linux, I seem to still get just the low eight bits. 这篇关于Linux,C ++,否定退出代码,说明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-01 15:50