ttyname (3) Linux Manual Page
ttyname, ttyname_r – return name of a terminal Synopsis #include <unistd.h> char *ttyname(int fd); int ttyname_r(int fd, char *buf, size_t buflen); Description The function ttyname() returns a pointer to the null-terminated pathname of the terminal device that is open on the file descriptor fd, or NULL on error (for example, if fd is not connected…
