가능/올바를 수 있습니까? "자식"프로세스의 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