<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    離弦之Ray

      BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
      55 Posts :: 0 Stories :: 33 Comments :: 0 Trackbacks
    A FIFO is similar to a pipe. A FIFO is a one-way flow of data (First In First Out). FIFOs have a name, so unrelated processes can share the FIFO. FIFO is a named pipe.

    FIFO和PIPE基本差不多,但FIFO是命名的,一些沒有親緣關系的process能共享它。

    Normally, opening a FIFO for read or write, it blocks until another process opens it for write or read. Write and read必須一一對應。

    A read gets as much data as it requests or as much data as the FIFO has, whichever is less.

    A write to a FIFO is atomic, as long as the write does not exceed the capacity of the FIFO. The capacity is at least 4k.


    How to set flags.

    writefd = open (FIFO1, O_WRONLY|O_ONOBLOCK,0);

    但是pipe沒有open函數

    所以只能這樣設定

    flags= fcntl (fd, F_GETFL,0);

    flag|=O_NONBLOCK;

    fcntl =(fd,F_SETFL,flags);


    下面的表很重要,要看清下面的前提操作和當前操作,主要比較了Blocking和O_NONBLOCK條件下的區別

    Operation

    Existing opens of pipe or FIFO

    Blocking (default)

    O_NONBLOCK set

    Open FIFO for reading

    FIFO open for writing

    Returns OK

    Returns OK

    FIFO not open for writing

    Blocks until FIFO is opened for writing

    Returns OK

    Open FIFO for writing

    FIFO open for reading

    Returns OK

    Returns OK

    FIFO not open for reading

    Blocks until FIFO is opened for reading

    Returns an error of ENXIO

    Read empty pipe or FIFO

    Pipe or FIFO open for writing

    Blocked until there is data or the pipe or FIFO is closed for writing

    Return an error of EAGAIN

    Pipe or FIFO not open for writing

    Read returns 0 (EOF)

    Read return 0 (EOF)

    Write to pipe or FIFO

    Pipe or FIFO open for reading

    Return ok

    Return ok

    Pipe or FIFO is full

    Blocked until space is available, then write data

    Returns an error of EAGAIN

    Pipe or FIFO not open for reading

    SIGPIPE generated, write process terminated

    Returns an error of EPIPE



    posted on 2006-06-20 23:42 離弦之ray的技術天空 閱讀(278) 評論(0)  編輯  收藏 所屬分類: Linux&C

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 亚洲精品午夜国产VA久久成人| 四虎永久在线精品视频免费观看| 亚洲人色婷婷成人网站在线观看| 美女一级毛片免费观看| 国产免费午夜a无码v视频| 99亚洲精品卡2卡三卡4卡2卡| 国产在线观看www鲁啊鲁免费| 国产成人亚洲综合a∨| 亚洲国产天堂久久久久久| 一级成人生活片免费看| 久久国产成人亚洲精品影院| 久久性生大片免费观看性| 亚洲AV永久无码区成人网站 | 亚洲情A成黄在线观看动漫软件| 99爱在线精品免费观看| 亚洲精华国产精华精华液网站| 国产福利免费观看| 永久免费观看黄网站| 久久精品国产精品亚洲| 久久精品成人免费看| 67194在线午夜亚洲| 免费在线观看亚洲| 中国精品一级毛片免费播放| 久久精品九九亚洲精品| 成**人免费一级毛片| 91av免费在线视频| 亚洲综合激情视频| 国产男女猛烈无遮挡免费视频| 久久er国产精品免费观看8| 亚洲日本在线观看| 成人永久福利免费观看| 中文在线免费看视频| 亚洲一区在线观看视频| 国产成人亚洲精品影院| 亚洲大片免费观看| 美女18一级毛片免费看| 亚洲综合一区二区精品导航| 免费真实播放国产乱子伦| 久久久久久AV无码免费网站下载| 亚洲AV无码一区二区一二区 | 亚洲视频在线精品|