随笔分类 -  Linux

GCC
摘要:/Files/chenhs/gcc.7z 阅读全文
posted @ 2012-01-14 05:17 大熊猫 阅读(151) 评论(0) 推荐(0)
fork两次如何避免僵尸进程
摘要:曾经觉得费解,温故知新一下:/*g++ -o New0001 New0001.cpp */#include <stdio.h>#include <sys/wait.h>#include <sys/types.h>#include <unistd.h>int main(void){ pid_t pid; if ((pid = fork()) < 0) { fprintf(stderr,"Fork error!\n"); exit(-1); } else if (pid == 0) /* first child */ { i 阅读全文
posted @ 2011-06-17 05:47 大熊猫 阅读(527) 评论(0) 推荐(0)