Is php fopen incompatible with POSIX open pipe

Why is this so confusing. PHP fopen will not open the file for reading if there is no data in the pipe waiting to be read (according to this comment ). The POSIX specification for open C states, which, depending on the state of the O_NONBLOCK flag, when opening a channel for writing, opens either blocks the calling process or returns an error if no process has an open file for reading. Is this difference compatible?

0
source share
1 answer

No. Php should signal C that it is waiting for a connection and then blocks input. C should loop until an open call returns -1 and errno == 6, followed by a fdopen handle. Enjoy it.

0
source

All Articles