The openpty()
function shall find an available pseudo-terminal
and return file descriptors for the master and slave devices in
the locations referenced by
amaster and aslave
respectively.
If name is not NULL,
the filename of the slave shall be placed in the user supplied buffer
referenced by name.
If termp is not NULL, it shall
point to a termios structure used to initialize
the terminal parameters of the slave pseudo-terminal device.
If winp is not NULL, it shall
point to a winsize structure used to initialize
the window size parameters of the slave pseudo-terminal device.