- 论坛徽章:
- 0
|
我的机器是HP的6600,操作系统是HP-UX B.11.23
我的测试程序如下:
#include <iostream>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
using namespace std;
int main(int argc, char ** argv)
{
int status = system(argv[1]);
printf(\"status=0x%x\\n\", status);
if (WIFEXITED(status))
printf(\"normal termination, exit status = %d\\n\",
WEXITSTATUS(status));
else if (WIFSIGNALED(status))
printf(\"abnormal termination, signal number = %d%s\\n\",
WTERMSIG(status),
#ifdef WCOREDUMP
WCOREDUMP(status) ? \" (core file generated)\" : \"\");
#else
\"\");
#endif
else if (WIFSTOPPED(status))
printf(\"child stopped, signal number = %d\\n\",
WSTOPSIG(status));
}
然后执行一些coredown的程序,测试结果如下:
1.浮点异常
***********> ./systest ./cored
sh: 6331 浮点异常(coredump)
status=0x8800
normal termination, exit status = 136
2.内存错误
***********> ./systest ./cored1
sh: 9202 内存错误(coredump)
status=0x8b00
normal termination, exit status = 139
大家帮忙看看,按照HP-UX的(man system) 的结果,这两个结果都应该是 (core file generated)的。
为啥我的coredown程序却没有 (core file generated)呢?到底coredown返回值是个什么样的结果呢? |
|