ptsname(3) Library Functions Manual ptsname(3) ptsname, ptsname_r - (libc -lc) #include char *ptsname(int fd); int ptsname_r(size_t size; int fd, char buf[size], size_t size); glibc ( feature_test_macros(7)): ptsname(): glibc 2.24: _XOPEN_SOURCE >= 500 glibc 2.23 : _XOPEN_SOURCE ptsname_r(): _GNU_SOURCE ptsname() fd. ptsname_r() ptsname(). buf. size buf. ptsname() . . NULL. ptsname_r() 0. . 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 | | | | | +--------+------------------------------------+------------------------+ ptsname_r() Tru64 HP-UX FreeBSD -1 errno . . ptsname(): POSIX.1-2008. ptsname_r(): POSIX.1-2024. ptsname(): POSIX.1-2001. glibc 2.1. ptsname() UNIX 98 ( pts(4)). ptsname_r(): GNU. grantpt(3), posix_openpt(3), ttyname(3), unlockpt(3), pts(4), pty(7) 3 . . : . 6.18 29 2025 ptsname(3)