我正在使用一个没有名称的管道,用于父母过程与通过论坛创建的儿童进程之间的交流。 我正在使用未开张的管道功能。 h
I would assume that once both file descriptors have been closed (and in both processes), that the pipe is deallocated/freed/destroyed/etc. But I haven t found anything in the man pages that says this definitively. I am making a program that will run for a very long time, so I want to prevent memory leaks and other things of that nature.
My function body looks something like:
int pipefds[2];
pipe( pipefds );
if ( fork() == 0 ) {
close( pipefds[1] );
...
//Use pipefds[0]
close( pipefds[0] );
} else {
close( pipefds[0] );
...
//Use pipefds[1]
close( pipefds[1] );
}
是否可安全地假设,在这项职能终止后,该管道已经分配/放开/停用/停用/提用。
Is there any documentation that says this definitively?
谢谢。