]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/ptsname.3
Import of man-pages 1.70
[thirdparty/man-pages.git] / man3 / ptsname.3
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\" This page is in the public domain. - aeb
3 .\"
4 .TH PTSNAME 3 "2003-01-30" "PTY Control" "Linux Programmer's Manual"
5 .SH NAME
6 ptsname \- get the name of the slave pseudotty
7 .SH SYNOPSIS
8 .nf
9 .B #define _XOPEN_SOURCE
10 .br
11 .B #include <stdlib.h>
12 .sp
13 .BI "char *ptsname(int " fd ");"
14 .fi
15 .SH DESCRIPTION
16 The
17 .BR ptsname ()
18 function returns the name of the slave pseudo-terminal device (pty)
19 corresponding to the master pty referred to by
20 .IR fd .
21 .SH "RETURN VALUE"
22 When successful,
23 .BR ptsname ()
24 returns a pointer to a string in static storage. This pointer
25 must not be freed.
26 .PP
27 Upon failure,
28 .BR ptsname ()
29 returns a NULL pointer.
30 .SH "CONFORMING TO"
31 POSIX 1003.1-2001.
32 This is part of the Unix98 pty support, see
33 .BR pts (4).
34 .SH "SEE ALSO"
35 .BR grantpt (3),
36 .BR ttyname (3),
37 .BR pts (4)