Re: ptsname() support (new ptys)

Mark M._Kettenis (
Sat, 17 Jan 1998 16:59:20 +0100

The guy to talk to for the glibc implementation of ptsname() et al. is
Zack Weinberg <>, CC'ed here.

He wrote me that he has an implementation for the relevant functions
ready for glibc:

FYI, I have an implementation of grantpt() et al for glibc already, it only
needs the kernel support. Three things are needful:

/dev/ptmx -> open this to get the next available pty master.
ioctl(pty_master, TIOCGRANT) -> chown()s you the slave device.
ioctl(pty_master, TIOCGSNAME, buf) ->stuff the slave name into buf.

I think we can get away with unlockpt() a noop. TIOCGSNAME can be simulated
in userspace by mapping the minor number to a name, but the kernel may want
to do it itself (eg. devfs doesn't have minor numbers).


Anyway, thanks for your effort,