How can I write a child process in my parent's STDIN in PHP?

In PHP, is there a way for the child process to be disabled using pcntl_fork() write data directly back to the parent stdin? I do not mean a separate tube - the stdin resource itself? (This should be stdin, because, in short, what the parent does will not work correctly if it cannot directly link its own stdin to the incoming data - a separate channel will not work.) As in:

 $pid = pcntl_fork(); if (!$pid) { // do fun child process stuff // write data back to parent STDIN } 
+4
source share
1 answer

On Linux (I donโ€™t know how much it would be for Unix in general), the 'stdin process can be obtained via /proc/$PID/fd/0 (as well as stdout / stderr in 1 and 2, not 0)

+1
source

Source: https://habr.com/ru/post/1333246/


All Articles