forkpty
pid_t forkpty(int *, char *, struct termios *, struct winsize *);
pid = forkpty(&master, line, NULL, &win);
if ((slave_pid = forkpty(&master, NULL, &term_attr, NULL)) < 0)