Unix98 PTYs + DevFS + Glibc 2.0.96

Clifford Wolf (clifford@clifford.at)
Fri, 2 Oct 1998 20:19:36 +0200 (MEST)


Hi,

I just try to use Unix98 PTYs and have a little problem here. I use the
kernel 2.1.123 + devfs and glibc 2.0.96. That's what the openpty function
of glibc does (I know this from reading the sourcecode and using strace):

1: open /dev/ptmx and using the resulting fd as master-pty
2: ioctl TIOCGPTN the fd from 1: to get the pty number
3: open /dev/pts/<pty-number> to use it as slave

And now what the kernel excepts the c-lib to do (I know this from running
var. test-progs - I've not went very deep into the unix98-pty-code of the
kernel):

1: open /dev/ptmx
2: ioctl TIOCGPTN the fd from 1: to get the pty number
3: open /dev/ptm/<pty-number> to use it as master
4: open /dev/pts/<pty-number> tu use it as slave
5: close the fd from 1:

If I use the code in glibc for getting a PTY I get an I/O Error at step 3.

If I use the 2nd code it works - unless I change the order of the steps 3
and 4 - this would result in an I/O Error in step 3 (opening the slave).

Does anyone know if the kernel or glibc is breaking the standard here? I
don't know if the error ocours without devfs too becouse my distribution
is devfs based and I don't have time to create regular a /dev directory ..

thanks,
clifford

-- -- -- -- -- -- -- -- -- -- -- -- --
Clifford Wolf
magnet - Internet at Work IRC: efnet / clifford
Director of System Development http://www.clifford.at/
e-mail: c.wolf@magnet.at email: god@clifford.at

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/