|
From: Roland G. <RGi...@a1...> - 2001-11-28 16:28:29
|
> I note that the new IO::Tty is "based on ideas from openssh and > Xemacs."Any ideas from Libes' original Expect in there? Have the > openssh and Xemacs > guys figured out a better way than he did or did they just borrow > from his method? How do all these different approaches compare? > > I'm just eaten up with curiosity. :) Then you need a speedy answer! :-) For pty allocation, I used ideas from openssh and Xemacs as they have a more modern approach. A lot of systems have incorporated some kind of cloning device in the meantime that weren't there when Tcl/Expect was developed. I concentrated on an idea from Xemacs, namely just figuring out what possibilities (libs/devices) are there and then trying all of them in order until one succeeds, the last one being the standard BSD- style technique of opening all /dev/pty*s one after another until an open succeeds. I collected several methods of allocating a pty from several sources. These are: openpty() _getpty() getpt() /dev/ptmx /dev/ptym/clone /dev/ptc /dev/ptmx_bsd If anybody knows about other methods, please let me know. Now what could be a problem is the pty setup: I use grantpt() and unlockpt() and push appropriate stream modules via ioctl, but there could be others necessary, esp. on older systems. The problem is that I can only rely on information in manpages etc. that I look up via Google, so I'm flying by instruments, pestering clients to get test results. What I used from Tcl/Expect was the method how spawn() works, namely using pipes to synchronize the parent with the forked child until the child has set up the pty, passing up a possible exec() error on the fly. Quite nifty! Any more questions? Roland -- RGi...@cp... |