Bug #64179 [Opn->Nab]: proc_open: all file handles are connected to same pty
| From: | mike@php.net | Date: | Thu, 03 Apr 2014 11:40:26 +0000 |
| Subject: | Bug #64179 [Opn->Nab]: proc_open: all file handles are connected to same pty | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-185064@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=64179&edit=1
ID: 64179
Updated by: mike@php.net
Reported by: php-bugs at dennis dot birkholz dot biz
Summary: proc_open: all file handles are connected to same
pty
-Status: Open
+Status: Not a bug
Type: Bug
Package: Streams related
Operating System: Linux
PHP Version: 5.4.11
Block user comment: N
Private report: N
New Comment:
There's not even PTY support in stock PHP.
Previous Comments:
------------------------------------------------------------------------
[2013-02-09 23:15:49] php-bugs at dennis dot birkholz dot biz
Description:
------------
If you open a program with proc_open and you connect both stdout and stderr of that program to a
pty, the same pty is used. If you use select_stream on both stdout and stderr, select marks both as
ready and you can not distinguish which one hash data as you can read from both resources.
Test script:
---------------
$descriptorspec = array(
0 => array("pipe", "r"),
1 => array("pty"),
2 => array("pty"),
);
$proc = proc_open("programpath", $descriptorspec, $handles = array());
stream_select($read = array($handles[1], $handles[2]), $write = null, $urgent = null, $timeout =
10);
// $read now contains $handles[1] AND $handles[2], does not matter where the data was written to
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64179&edit=1