进程与管道的使用
参考原文链接: https://blog.youkuaiyun.com/nodeathphoenix/article/details/23284157?utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2allbaidu_landing_v2~default-1-23284157.nonecase
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
int main()
{
int count=0;
int r_num;
int w_num;
char r_buf[128];
printf("fork before\n");
// 通道pipe要在创建新进程前开启
int pipefd[2];
int pipe_ret = pipe(pipefd);
printf("create pipe, and ret=%d\n",pipe_ret);