Aren't pipes in UNIX supposed to be uni-directional?

后端 未结 3 1004
予麋鹿
予麋鹿 2021-01-02 12:30

Have a look at the following code:

#include
#include
#include
#include
#include

        
3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-02 12:44

    No they aren't. There have been some systems with bidirectional pipes (sun, IIRC). If you really need a bidirectional pipe, you could use socketpair().

提交回复
热议问题