openpty(3) Library Functions Manual openpty(3) openpty, login_tty, forkpty - (libutil -lutil) #include int openpty(int *amaster, int *aslave, char *name, const struct termios *termp, const struct winsize *winp); pid_t forkpty(int *amaster, char *name, const struct termios *termp, const struct winsize *winp); #include int login_tty(int fd); openpty() amaster aslave. name NULL name. termp NULL termp. winp NULL winp. login_tty() fd ( openpty()) fd fd fd. forkpty() openpty() fork(2) login_tty() . amaster. name NULL . termp winp NULL . openpty() login_tty() forkpty() -1 errno . openpty() login_tty() forkpty() 0 forkpty() . openpty() : ENOENT . login_tty() ioctl(2) fd . forkpty() openpty() fork(2). attributes(7). +----------------------+------------------------------------+--------------------------------------------------------------------------------------------------------+ | | | | +----------------------+------------------------------------+--------------------------------------------------------------------------------------------------------+ |forkpty() | | (locale) (MT-Safe) | |openpty() | | | +----------------------+------------------------------------+--------------------------------------------------------------------------------------------------------+ |login_tty() | | (MT-Unsafe) :ttyname | +----------------------+------------------------------------+--------------------------------------------------------------------------------------------------------+ BSD. const openpty() forkpty() glibc 2.8. glibc 2.0.92 openpty() BSD glibc 2.0.92 UNIX 98 BSD . name. openpty() forkpty() name NULL . fork(2), ttyname(3), pty(7) 3 . . : . 6.18 17 2025 openpty(3)