1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\" This page is in the public domain. - aeb
4 .\" 2004-12-17, mtk, added description of ptsname_r() + ERRORS
6 .TH PTSNAME 3 2008-09-03 "" "Linux Programmer's Manual"
8 ptsname, ptsname_r \- get the name of the slave psuedoterminal
11 .B #define _XOPEN_SOURCE
13 .B #include <stdlib.h>
15 .BI "char *ptsname(int " fd ");"
17 .B #define _GNU_SOURCE
19 .B #include <stdlib.h>
21 .BI "int ptsname_r(int " fd ", char *" buf ", size_t " buflen ");"
26 function returns the name of the slave psuedoterminal device
27 corresponding to the master referred to by
32 function is the reentrant equivalent of
34 It returns the name of the slave psuedoterminal device as a
35 null-terminated string in the buffer pointed to by
39 argument specifies the number of bytes available in
44 returns a pointer to a string in static storage which will be
45 overwritten by subsequent calls.
46 This pointer must not be freed.
47 On failure, a NULL pointer is returned.
52 On failure, a nonzero value is returned
55 is set to indicate the error.
56 .\" In fact the errno value is also returned as the function
57 .\" result -- MTK, Dec 04
68 does not refer to a psuedoterminal master device.
77 is provided in glibc since version 2.1.
80 is part of the UNIX 98 psuedoterminal support (see
82 This function is specified in POSIX.1-2001.
86 A version of this function is documented on Tru64 and HP-UX, but
87 on those implementations, \-1 is returned on error, with
89 set to indicate the error.
90 Avoid using this function in portable programs.
97 .BR feature_test_macros (7),