方林

再多的天才也无法胜过对细节的关注
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年5月17日

摘要: 一.思维导图 二.实例讲解1.wait()#include <sys/types.h>#include <sys/wait.h>#include <unistd.h>#include <stdio.h>int main(){ pid_t pc, pr; pc = fork(); if(pc<0){ printf("fork error\n"); }else if(pc == 0){ printf("this is child process.\n"); }else{ sleep(20); printf 阅读全文

posted @ 2012-05-17 15:49 fl_dream 阅读(768) 评论(0) 推荐(0) 编辑

摘要: 一.先来看下思维导图,以快速认知。 二.实例讲解实例一.#include <sys/types.h>#include <unistd.h>#include <stdio.h>int main(){ pid_t pid; pid = fork(); if(pid<0){ printf("error in fork"); }else if(pid == 0){ printf("This is child process, pid is %d\n", getpid()); }else{ printf("Thi 阅读全文

posted @ 2012-05-17 13:51 fl_dream 阅读(326) 评论(0) 推荐(0) 编辑