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
相關文章
相關標籤/搜索