#33147 [Opn->Asn]: pty pseudo terminal is not support on this system in
| From: | sniper@php.net | Date: | Fri, 27 May 2005 06:54:02 +0000 |
| Subject: | #33147 [Opn->Asn]: pty pseudo terminal is not support on this system in | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-79589@lists.php.net to get a copy of this message | ||
ID: 33147
Updated by: sniper@php.net
Reported By: skissane at iips dot mq dot edu dot au
-Status: Open
+Status: Assigned
Bug Type: Program Execution
Operating System: Linux
PHP Version: 5.0.4
-Assigned To:
+Assigned To: wez
New Comment:
Reason for it being turned off is here:
revision 1.27
date: 2004/05/29 09:27:18; author: wez; state: Exp; lines: +3 -3
Turn this off then
===========================================================
Pretty cryptic, if I may say so. Assigning to Wez who
propably had some reason to do it but didn't (as usual)
want to tell the rest of us why..
Previous Comments:
------------------------------------------------------------------------
[2005-05-27 01:29:27] skissane at iips dot mq dot edu dot au
Tested with the patch you supplied. (Patch would not apply, so I had to
apply most of it by hand.) My test case works with the test you
supplied, and --enable-pty supplied as a config option.
------------------------------------------------------------------------
[2005-05-26 10:16:03] tony2001@php.net
Please test the patch in this letter:
http://www.mail-archive.com/internals@lists.php.net/msg14854.html
------------------------------------------------------------------------
[2005-05-26 09:57:11] skissane at iips dot mq dot edu dot au
I've been running some tests of mine own, and it seems to work for me.
Here is a PHP test case for this bug:
(Note, I should have a SKIPIF which tests for the existence of the
ptsname(), grantpt() and unlockpt() C language functions on the
system... but I don't know how to write such a SKIPIF test...)
--TEST--
Bug #33147 (proc_open: basic test of Unix98 PTYs functionality)
--FILE--
<?php
// Create a pseudo terminal for the child process
$descriptorspec = array(
0 => array("pty"),
1 => array("pty"),
2 => array("pty")
);
$process = proc_open("echo this is working", $descriptorspec, $pipes);
if (is_resource($process)) {
echo "OK\n";
while (!feof($pipes[1]))
echo fread($pipes[1],1024);
}
?>
--EXPECT--
OK
this is working
------------------------------------------------------------------------
[2005-05-26 09:24:00] skissane at iips dot mq dot edu dot au
With the "#if 0" removed, my test case works fine.
I have a more complex application I have been developing with
proc_open, which might really benefit from pty support. I shall now
test it with that application.
------------------------------------------------------------------------
[2005-05-26 08:36:53] skissane at iips dot mq dot edu dot au
Looked at ext/standard/proc_open.c, lines 59-63. Found the following
code:
#if 0 && HAVE_PTSNAME && HAVE_GRANTPT && HAVE_UNLOCKPT &&
HAVE_SYS_IOCTL_H && HAVE_TERMIOS_H
# include <sys/ioctl.h>
# include <termios.h>
# define PHP_CAN_DO_PTS 1
#endif
Why is this "#if 0"? Is it broken? The docs state that the feature is
available in PHP 5 or greater. I will try removing the #if 0, and
seeing what happens.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/33147
--
Edit this bug report at http://bugs.php.net/?id=33147&edit=1