标签: c linux process pipe fork
我正在尝试在多个进程之间建立通信,但是我不确定是否可以仅使用一个管道来进行通信。 管道启动并像这样使用后:
int fd[2]; int pid = fork(); if(pid == 0){ //do the writing }else if(pid > 0){ //read what's written by child }
子进程可以覆盖管道的写头以获得新值吗?还是仅一次使用?
谢谢。