阅读背景:

UNIX / Linux IPC:从管道读取。如何在运行时知道数据长度?

来源:互联网 

I have a child process which generates some output of variable length and then sends it to the parent using a half duplex pipe. In the parent, how do I use the read() function? Since the data can be of different length each time, how can I at run time know the size of the data to do any malloc() for a buffer? Can the fstat() function be used on a pipe file descriptor?I have a child process which generates some out




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: