O_RDWR on named pipes with poll()

后端 未结 2 1699
别跟我提以往
别跟我提以往 2020-12-12 21:12

I have gone through a variaty of different linux named pipe client/server implementations but most of them use the blocking defaults on reads/writes.

As I am already

2条回答
  •  無奈伤痛
    2020-12-12 21:58

    According to open(2) man page, you can pass O_RDONLY|O_NONBLOCK or O_WRONLY|O_NONBLOCK to avoid the open syscall to be blocked (you'll get errno == ENXIO in that case)

    As I commented read also the fifo(7) and mkfifo(3) man pages.

提交回复
热议问题