Find an available pseudo-tty
#include <unix.h>
int openpty( int* amaster,
int* aslave,
char* name,
struct termios* termp,
struct winsize* winp );
libc
The openpty() function finds an available pseudo-tty and returns file descriptors for the master and slave in amaster and aslave. If name is non-NULL, the filename of the slave is returned in it. If termp is non-NULL, the terminal parameters of the slave is set to the values in termp. If winp is non-NULL, the window size of the slave is set to the values in it.
| Safety: | |
|---|---|
| Cancellation point | Yes |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |
fork(), forkpty(), login_tty()