[lug] Pseudo-terminals

D. Stimits stimits at idcomm.com
Tue Mar 5 20:46:54 MST 2002


Most device special files have an ioctl associated with their particular
class of file. Those in turn are basically created in the kernel driver
for the device. To fool something into thinking it is talking to a
serial port probably requires making the ioctl's of the serial port
available. If you cannot modify the application, then you will have to
emulate a serial port, probably through a module. I do not know what set
of ioctl's are available to a pty, or a tty, but you should probably
start by comparing ioctl's of a serial port with that of a pty. Perhaps
you will be better off just writing a kernel module that has all the
characteristics of a serial port but forwards to some other interface
that you can control, as a sort of adapter.

D. Stimits, stimits at idcomm.com

Bryan Field-Elliot wrote:
Hi all,

I posted this message a couple of months ago but got no satisfactory
response.

I have an application which thinks it's connecting to a serial port (I
pass in the /dev/ as a command-line parameter). I want to redirect this
to a telnet daemon, so that I can telnet into this system rather than
hook up a real modem (which it wants).

I think pseudo-terminals are my answer, but, I don't know how they
really work. I can't find any meaning documentation on pseudo-terminals
(other than two-paragraph overviews), and I can't find any
swiss-army-knife utilities which will let me work with them. If anyone
can point me in the right direction, I'd sure appreciate it.

Obviously, this little setup should allow only one person into the
telnet port at a time (since there's only one copy of the back-end
software running); other simultaneous attempts should be met with a
message such as "port is busy, please try again later" etc.

Thanks in advance,

Bryan



More information about the LUG mailing list