int openpt(string mode)
Open the master end of a pseudo-terminal pair.
This function returns 1 for success, 0 otherwise.
1
0
grantpt()
Open the master end of a pseudo-terminal pair. The parameter mode should contain one or more of the following letters:
Open terminal for reading.
Open terminal for writing.
mode should always contain at least one of the letters "r" or "w".
"r"
"w"