ptsname(3) Library Functions Manual ptsname(3) ptsname, ptsname_r - - LIBRARY Standard C library (libc, -lc) #include char *ptsname(int fd); int ptsname_r(int fd, char buf[.buflen], size_t buflen); glibc (. feature_test_macros(7)): ptsname(): glibc 2.24: _XOPEN_SOURCE >= 500 glibc 2.23 : _XOPEN_SOURCE ptsname_r(): _GNU_SOURCE The ptsname() function returns the name of the slave pseudoterminal device corresponding to the master referred to by the file descriptor fd. ptsname_r() ptsname(). - ( null) , buf. buflen , buf. ptsname() , . . NULL. On success, ptsname_r() returns 0. On failure, an error number is returned to indicate the error. EINVAL ( ptsname_r()) buf NULL ( glibc 2.25 ). ENOTTY fd -. ERANGE ( ptsname_r()) buf . attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |ptsname() | | MT-Unsafe race:ptsname | +----------------------------+----------------------------------------------------------+--------------------------+ |ptsname_r() | | MT-Safe | +----------------------------+----------------------------------------------------------+--------------------------+ A version of ptsname_r() is documented on Tru64 and HP-UX, but on those implementations, -1 is returned on error, with errno set to indicate the error. Avoid using this function in portable programs. ptsname(): POSIX.1-2008. ptsname_r() is a Linux extension, that is proposed for inclusion in the next major revision of POSIX.1 (Issue 8). ptsname(): POSIX.1-2001. glibc 2.1. ptsname() - UNIX 98 ( pts(4)). . grantpt(3), posix_openpt(3), ttyname(3), unlockpt(3), pts(4), pty(7) Alexey, Azamat Hackimov , kogamatranslator49 , Kogan, Max Is , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . ptsname(3)