当前位置: 技术问答>linux和unix
fork 与 pipe
来源: 互联网 发布时间:2016-11-06
本文导语: int main() { int pipe_fd[2]; pid_t pid; char r_buf[4]; char w_buf[4]; pid_t ppid; ppid = getpid(); printf("parent:%dn",ppid); for(int i=0; i
int main()
{
int pipe_fd[2];
pid_t pid;
char r_buf[4];
char w_buf[4];
pid_t ppid;
ppid = getpid();
printf("parent:%dn",ppid);
for(int i=0; i
{
int pipe_fd[2];
pid_t pid;
char r_buf[4];
char w_buf[4];
pid_t ppid;
ppid = getpid();
printf("parent:%dn",ppid);
for(int i=0; i