1 .\" %%%LICENSE_START(PUBLIC_DOMAIN)
2 .\" This page is in the public domain. - aeb
5 .\" 2004-12-17, mtk, added description of ptsname_r() + ERRORS
7 .TH PTSNAME 3 2013-06-21 "" "Linux Programmer's Manual"
9 ptsname, ptsname_r \- get the name of the slave pseudoterminal
12 .BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
14 .B #include <stdlib.h>
16 .BI "char *ptsname(int " fd ");"
18 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
20 .B #include <stdlib.h>
22 .BI "int ptsname_r(int " fd ", char *" buf ", size_t " buflen ");"
27 function returns the name of the slave pseudoterminal device
28 corresponding to the master referred to by
33 function is the reentrant equivalent of
35 It returns the name of the slave pseudoterminal device as a
36 null-terminated string in the buffer pointed to by
40 argument specifies the number of bytes available in
45 returns a pointer to a string in static storage which will be
46 overwritten by subsequent calls.
47 This pointer must not be freed.
48 On failure, NULL is returned.
53 On failure, a nonzero value is returned
56 is set to indicate the error.
57 .\" In fact the errno value is also returned as the function
58 .\" result -- MTK, Dec 04
69 does not refer to a pseudoterminal master device.
78 is provided in glibc since version 2.1.
80 .SS Multithreading (see pthreads(7))
83 function is not thread-safe.
87 function is thread-safe.
90 is part of the UNIX 98 pseudoterminal support (see
92 This function is specified in POSIX.1-2001.
96 A version of this function is documented on Tru64 and HP-UX, but
97 on those implementations, \-1 is returned on error, with
99 set to indicate the error.
100 Avoid using this function in portable programs.
103 .BR posix_openpt (3),
109 This page is part of release 3.64 of the Linux
112 A description of the project,
113 and information about reporting bugs,
115 \%http://www.kernel.org/doc/man\-pages/.