8_5 print exit status
2015-10-20 15:13
399 查看
WIFEXITED
WIFSIGNALED
WCOREDUMP
WIFSTOPPED
1 #include "apue.h"
2 #include <sys/wait.h>
3
4 void pr_exit(int status)
5 {
6 if( WIFEIXTED(status) )
7 printf("normal termination,exit status = %d\n",WEXITSTATUS(status));
8 else if (WIFSIGNALED(status))
9 printf("abnormal termination, signal number = %d%s\n",WTERMSIG(status),
10 #ifdef WCOREDUMP
11 WCOREDUMP(status) ? " (core file generated)" : "");
12 #else
13 "");
14 #endif
15 else if (WIFSTOPPED(status))
16 printf("child stopped, signal number = %d\n", WSTOPSIG(status));
17 }
WIFSIGNALED
WCOREDUMP
WIFSTOPPED
1 #include "apue.h"
2 #include <sys/wait.h>
3
4 void pr_exit(int status)
5 {
6 if( WIFEIXTED(status) )
7 printf("normal termination,exit status = %d\n",WEXITSTATUS(status));
8 else if (WIFSIGNALED(status))
9 printf("abnormal termination, signal number = %d%s\n",WTERMSIG(status),
10 #ifdef WCOREDUMP
11 WCOREDUMP(status) ? " (core file generated)" : "");
12 #else
13 "");
14 #endif
15 else if (WIFSTOPPED(status))
16 printf("child stopped, signal number = %d\n", WSTOPSIG(status));
17 }
相关文章推荐
- Linux下wait, WIFEXITED, WEXITSTATUS的比较
- wait获取子进程退出状态 WIFEXITED和WIFSIGNALED用法
- json jquery 解析
- css浮动
- JSF生命周期
- JQuery Ajax学习
- fastjson解析json数据
- css浮动
- HTML 标签学习
- 本期介绍SBJson的用法,收集。
- javascript省市级联功能实现方法实例详解
- 常见的正则表达式问题
- prototypejs库Function#wrap()的使用和源码解析
- 人人必知的10个 jQuery 小技巧
- 让不支持HTML5的老浏览器 “兼容”HTML5
- CSS高级技巧
- 基于JavaScript实现移动端TAB触屏切换效果
- js点击文本框后才加载验证码实例代码
- 深入理解JavaScript原型:prototype,__proto__和constructor
- javascript实现状态栏中文字动态显示的方法