Linux下父进程与两子进程管道通讯

#include<stdio.h> #include<stdlib.h> #include<unistd.h> #include<string.h> int main() {int fd[2]; pid_t pid1,pid2; char sendbuf[50],revbuf[50]; pipe(fd); pid1=fork(); if(pid1==0) {lockf(fd[1],1,0); sp
相关文章
相关标签/搜索