これは可能ですか正しいですか?私が "child"プロセスのfd1 [1]から書き込みを行うと、 "father"プロセスのfd2 [0]から読み込むことが可能になりますか?フォーク後にパイプを作成する
main(){
pid_t pid;
pid = fork();
if(pid <0){
return -1;
}
if(pid == 0){
int fd1[2];
int fd2[2];
pipe(fd1);
pipe(fd2);
close fd1[1];
close fd2[0];
//writes & reads between the fd1 pipes
//writes & reads between the fd2 pipes
}else{
int fd1[2];
int fd2[2];
pipe(fd1);
pipe(fd2);
close fd1[1];
close fd2[0];
//writes & reads between the fd1 pipes
//writes & reads between the fd2 pipes
}
}
あなたの質問は何ですか?私は自分自身をテストすることができないもののようには見えません。 – Tudor