首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

fopen 打开定名管道阻塞

2012-08-02 
fopen 打开命名管道阻塞使用fopen以写的方式打开命名管道,若没有别的进程/线程以读的方式打开命名管道,该

fopen 打开命名管道阻塞

使用fopen以写的方式打开命名管道,若没有别的进程/线程以读的方式打开命名管道,该函数将一直阻塞。

?写道O_NONBLOCK
When opening a FIFO with O_RDONLY or O_WRONLY set: If O_NONBLOCK is set:
An open() for reading only will return without delay. An open() for writing only will return an error if no process currently has the file open for reading.
If O_NONBLOCK is clear:
An open() for reading only will block the calling thread until a thread opens the file for writing. An open() for writing only will block the calling thread until a thread opens the file for reading.

?

参考?http://pubs.opengroup.org/onlinepubs/007908799/xsh/open.htmlhttp://stackoverflow.com/questions/580013/how-do-i-perform-a-non-blocking-fopen-on-a-named-pipe-mkfifoLinux命名管道FIFO的读写规则

?

?

热点排行