Determine the size of a pipe without calling read()

后端 未结 13 954
无人共我
无人共我 2020-12-19 03:56

I need a function called SizeOfPipe() which should return the size of a pipe - I only want to know how much data is in the pipe and not actually read data off t

13条回答
  •  盖世英雄少女心
    2020-12-19 04:44

    I don't think it is possible, isn't the point of a pipe to provide interprocess communication between the two ends (in one direction). If I'm correct in that assertion, the send may not yet have finished pushing data into the pipe -- so it'd be impossible to determine the length.

    What platform are you using?

提交回复
热议问题