退出状态代码 4479
有人知道退出状态代码 4479 (0x117f) 在 Ubuntu Linux 系统上意味着什么吗?我在没有程序编码的情况下得到了这个(我只有 EXIT_SUCCESS 和 EXIT_FAILURE,分别是 0 和 1),而且我似乎找不到 255 以上的此类代码的列表。谢谢!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个 4479 或 0x117f 看起来像是从 C/C++
system() 返回的内容
调用(与 Unix$?
预定义变量,可能只有0-255)。鉴于您使用的是 Linux,您很可能使用 glibc。因此,在这种情况下,该值不是 0-255
exit()
status,但其格式类似于waitpid() 设置的状态
(可能包含退出状态,但在本例中可能没有)。如果是这样,则 来源告诉我,
WIFSTOPPED(4479)
将返回true,而WSTOPSIG(4479)
将返回17。(请参阅waitpid()
手册页了解更多信息。)因此 4479 的进程返回尚未退出,仍然存在,但被信号 17 停止。信号 17 是 SIGCHLD (至少如果您在 x86 上运行 Linux),这意味着“子进程已停止或终止”。
在不了解您的特定应用程序上下文的更多信息的情况下,我不知道为什么会发生 SIGCHLD。
This 4479 or 0x117f looks like something you would see returned from a C/C++
system()
call (as opposed to the value of the Unix$?
predefined variable, which may be only 0-255). And given that you're on Linux, you are very likely using glibc.So in that case this value is not a 0-255
exit()
status, but instead it is formatted like the status set bywaitpid()
(which could contain an exit status, but probably didn't in this case).If so, then the source tells me that
WIFSTOPPED(4479)
would return true, and thatWSTOPSIG(4479)
would return 17. (See thewaitpid()
man page for more information.) So the process for which 4479 is returned has not exited and is still there, but it was stopped by signal 17.Signal 17 is SIGCHLD (at least if you're running Linux on x86), which means "Child [process] stopped or terminated".
Without knowing more about your specific application context, I have no idea why that SIGCHLD occurs.
看起来这是从 status 值rel="nofollow">
wait()
或waitpid()
,与退出状态不同。宏WIFEXITED()
、WIFSIGNALED()
、WIFSTOPPED()
和WIFCONTINUED()
应用于状态值来确定其含义。在本例中,WIFSTOPPED()
对于 status 的值来说似乎为 true,这意味着子进程已停止。It looks like this is the status value obtained from
wait()
orwaitpid()
, which is not the same as the exit status. The macrosWIFEXITED()
,WIFSIGNALED()
,WIFSTOPPED()
, andWIFCONTINUED()
should be used on the status value to determine its meaning. In this case it looks likeWIFSTOPPED()
would be true for this value of status, which means that the child process was stopped.