> also, the `protocol' of creating new /dev/pts/* is somewhat sensible, too. no
> ioctl(), just open /dev/pmtx, read a textual representation of an integer N
> and open /dev/pts/N.

nah, slave name is obtained with ptsname(master) which does
ioctl(TIOCGPTN) on Linux.

...
open("/dev/ptmx", O_RDWR|O_NOCTTY)      = 3
statfs("/dev/pts", {f_type="DEVPTS_SUPER_MAGIC", f_bsize=4096,
f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0,
0}, f_namelen=255, f_frsize=4096}) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(3, TIOCGPTN, [8])                 = 0
stat64("/dev/pts/8", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 8), ...}) = 0
...

AIX does too:
...
kopen("/dev/ptc", O_RDWR|O_NOCTTY)              = 3
__loadx(0x01480180, 0x2FF21B50, 0x00000A50, 0xF06AFBB4, 0x00000000) = 0xF0FE4A28
_kgrantpt(0x00000003, 0x00000001, 0xF065F3F8, 0x0000D032, 0x00000003,
0x00000350, 0x00000000, 0x00000000) = 0x00000000
kioctl(3, 536900678, 0x2FF22670, 0x00000000)    = 0
kioctl(3, 536900679, 0x2FF225F0, 0x00000000)    = 0
kioctl(3, 22529, 0x2FF221B4, 0x00000000)        = 0
statx("/dev/pts/27", 0x2FF221D8, 76, 0)         = 0
...

Reply via email to