Subject: Linux pseudo tty
To: None <tech-kern@netbsd.org>
From: Emmanuel Dreyfus <p99dreyf@criens.u-psud.fr>
List: tech-kern
Date: 02/13/2001 23:37:42
Here is the ktrace of Linux's xterm on PowerPC.

   210 xterm    CALL  ioctl(0x4,_IOR('T',0x30,0x4),0x7fffd178)
   210 xterm    RET   ioctl 0
   210 xterm    CALL  stat(0x5040ce08,0x7fffcbc8)
   210 xterm    NAMI  "/emul/linux/dev/pts/0"
   210 xterm    NAMI  "/dev/pts/0"
   210 xterm    RET   stat -1 errno 2 No such file or directory

_IOR('T',0x30,0x4) is LINUX_TIOCGPTN, it should return the pty number. I
implemented it like this

        case LINUX_TIOCGPTN:    /* get Pty number */
                tty = curproc->p_pgrp->pg_session->s_ttyp;
                idat = minor(tty->t_dev);
                error = copyout (&idat, SCARG(uap,data), sizeof idat);

It seems Linux uses things we don't do (the /dev/pts stuff). I've got
very basic understanding of the tty stuff. Anyone can explain me what is
going wrong?

-- 
Emmanuel Dreyfus.  
Hiroshima 45. Tchernobyl 86. Windows 95. 
p99dreyf@criens.u-psud.fr