Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!rex!ukma!usenet.ins.cwru.edu!gatech!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!axion!uzi-9mm.fulcrum.bt.co.uk!igb From: igb@fulcrum.bt.co.uk (Ian G Batten) Newsgroups: comp.unix.questions Subject: PTYs with V.4 Message-ID: <*&8^4!*@uzi-9mm.fulcrum.bt.co.uk> Date: 24 Jan 91 17:28:55 GMT Sender: isode@fulcrum.bt.co.uk (Isode Hackers) Organization: BT Fulcrum, Birmingham Lines: 34 I'm trying to port a program which uses the BSD pty mechanism in a fashion akin to telnet to V.4. [[ The application is the ISODE 6.0 VT daemon ]] I get a master side by opening /dev/ptmx, call unlockpt on the result, ptsname on the result and finally open the result of the ptsopen. That's my slave. Then I push (in order) ptem, ldterm and ttcompat streams modules. The call TIOCGETP then fails EINVAL. Bearing in mind I know precious little about streams, can anyone suggest if I've made an obvious boob or if there are any places I would be adviced to start looking for the problem? Outline of the code: p = open ("/dev/ptmx", 2); cp = ptsname (p); unlockpt (p); t = open(cp, 2); if ((ioctl (t, I_PUSH, "ptem") < 0) || (ioctl (t, I_PUSH, "ldterm") < 0) || (ioctl (t, I_PUSH, "ttcompat") < 0)) fatalperror (f, "stream push", errno); if (ioctl(t, TIOCGETP, (char*)&b) == -1) { perror("ioctl (TIOCGETP)"); adios(NULLCP, "ioctl failed (TIOCGETP)"); } <== fails here ian