WIFEXITED/WEXITSTATUS/WIFSIGNALED
来源:互联网 发布:软件售前工程师 编辑:程序博客网 时间:2024/04/30 12:51
If the exit status value (*note Program Termination::) of the child
process is zero, then the status value reported by `waitpid' or `wait'
is also zero. You can test for other kinds of information encoded in
the returned status value using the following macros. These macros are
defined in the header file `sys/wait.h'.
-- Macro: int WIFEXITED (int STATUS)
This macro returns a nonzero value if the child process terminated
normally with `exit' or `_exit'.
-- Macro: int WEXITSTATUS (int STATUS)
If `WIFEXITED' is true of STATUS, this macro returns the low-order
8 bits of the exit status value from the child process. *Note
Exit Status::.
-- Macro: int WIFSIGNALED (int STATUS)
This macro returns a nonzero value if the child process terminated
because it received a signal that was not handled. *Note Signal
Handling::.
子进程的结束状态返回后存于status,底下有几个宏可判别结束情况
WIFEXITED(status)如果子进程正常结束则为非0值。
WEXITSTATUS(status)取得子进程exit()返回的结束代码,一般会先用WIFEXITED 来判断是否正常结束才能使用此宏。
WIFSIGNALED(status)如果子进程是因为信号而结束则此宏值为真
WTERMSIG(status)取得子进程因信号而中止的信号代码,一般会先用WIFSIGNALED 来判断后才使用此宏。
WIFSTOPPED(status)如果子进程处于暂停执行情况则此宏值为真。一般只有使用WUNTRACED 时才会有此情况。
WSTOPSIG(status)取得引发子进程暂停的信号代码.
- WIFEXITED/WEXITSTATUS/WIFSIGNALED
- WIFEXITED WEXITSTATUS WIFSIGNALED
- WIFEXITED/WEXITSTATUS/WIFSIGNALED
- WIFEXITED/WEXITSTATUS/WIFSIGNALED
- WIFEXITED/WEXITSTATUS/WIFSIGNALED
- WIFEXITED/WEXITSTATUS/WIFSIGNALED
- WIFEXITED/WEXITSTATUS/WIFSIGNALED
- WIFEXITED/WEXITSTATUS/WIFSIGNALED
- WIFEXITED/WEXITSTATUS/WIFSIGNALED
- WIFEXITED/WEXITSTATUS/WIFSIGNALED
- WIFEXITED WEXITSTATUS WIFSIGNALED
- system()与WIFEXITED/WEXITSTATUS/WIFSIGNALED
- WIFEXITED WIFSTOPPED WIFSIGNALED用法
- WIFEXITED WIFSTOPPED WIFSIGNALED用法
- wait, WIFEXITED, WEXITSTATUS
- WEXITSTATUS与WIFEXITED
- system函数,WIFEXITED和WEXITSTATUS
- system/WIFEXITED/WEXITSTATUS函数-linux
- 打印出Ibatis最终的SQL语句
- Asp.Net中String.Empty、null和""的区别
- 软件工程之项目团队分工
- gdb查看内存
- Flot使用文档 API
- WIFEXITED/WEXITSTATUS/WIFSIGNALED
- 模拟银行窗口排队叫号系统的运作
- VC基于对话框的程序中,按ESC键窗口不关闭
- FGS 视频均等质量流化算法
- POJ1106(计算几何 判断折线方向)
- Repeater控件嵌套--多级目录
- iOS 4.2.1版iPad绿毒Win完美越狱教程
- asp.net 动态抓取网站数据(方法一)
- SecureCRT突然假死的问题(Ctrl+S)