0
为什么函数open()
在Unix中对于FIFO是不对称的?为什么我们需要首先打开先进先出读取然后写入? 在linux/fs/fifo.c
写:为什么FIFO文件在打开之前必须打开才能读取?
/*
* O_RDONLY
* POSIX.1 says that O_NONBLOCK means return with the FIFO
* opened, even when there is no process writing the FIFO.
*/
/********
* O_WRONLY
* POSIX.1 says that O_NONBLOCK means return -1 with
* errno=ENXIO when there is no process reading the FIFO.
*/
为什么不能老是我们首先打开一个只写后读?