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 For an explanation of the terms used in this section, see
86 Interface Attribute Value
89 T} Thread safety MT-Unsafe
92 T} Thread safety MT-Safe
96 is part of the UNIX 98 pseudoterminal support (see
98 This function is specified in POSIX.1-2001.
101 is a Linux extension.
102 A version of this function is documented on Tru64 and HP-UX, but
103 on those implementations, \-1 is returned on error, with
105 set to indicate the error.
106 Avoid using this function in portable programs.
109 .BR posix_openpt (3),