linux命名管道编程问题
发布网友
发布时间:2022-04-28 20:48
我来回答
共1个回答
热心网友
时间:2022-06-23 03:44
Once you have created a FIFO special file in this way, any process can open it for reading or writing, in the same way as an ordinary
file. However, it has to be open at both ends simultaneously before you can proceed to do any input or output operations on it.
Opening a FIFO for reading normally blocks until some other process opens the same FIFO for writing, and vice versa. See fifo(7) for
non-blocking handling of FIFO special files.
这个是 man 3 mkfifo里面有关fifo的描述。
你要用写方式或读方式打开FIFO,必须有另外一端有相对的方式打开才能能够继续。