It seems that a simple shell redirect from /dev/ptmx gets me a new pseudo-terminal.
$ ls /dev/pts; ls /dev/pts </dev/ptmx
0 1 2 ptmx
0 1 2 3 ptmx
It disappears as soon as the process that owns the fd claim on /dev/ptmx quits, but it is simple enough to retain it:
$ PS1='<$(ls -1 "$@" /dev/pts/*|uniq -u)> $ ' \
exec 3<>/dev/ptmx "$0" -si -- /dev/pts/*
</dev/pts/3> $ ls /dev/pts; exec 3>&-
0 1 2 3 ptmx
<> $ ls /dev/pts; exec 3<>/dev/ptmx
0 1 2 ptmx
</dev/pts/3> $ exit
So it looks like the simple open() on /dev/ptmx is enough to get a pseudo-terminal. I guess that would make the shell - (or the process for which it does the redirect) - the owner of the master side of the pty.
But how do I assign the slave side - or can I assign the slave side? And if I can - what can I do with it? Can I affect its read/write/flush timings w/ stty? Will a slave side process link through to my new pty when referencing /dev/tty?