|
|
|
|
close(pipe_fd[0]);
exit();
}
else if(pid>0)
{
close(pipe_fd[0]);//read
strcpy(w_buf,"111");
if(write(pipe_fd.,w_buf,4)!=-1)
printf("parent write over\n");
close(pipe_fd.);//write
printf("parent close fd. over\n");
sleep(10);
}
}
程序输出结果:
页码:[1] [2] [3] [4] [5] 第4页、共5页 |
|
|