man-pages/man3/ptsname.3

38 lines
840 B
Groff

.\" Hey Emacs! This file is -*- nroff -*- source.
.\" This page is in the public domain. - aeb
.\"
.TH PTSNAME 3 "2003-01-30" "PTY Control" "Linux Programmer's Manual"
.SH NAME
ptsname \- get the name of the slave pseudotty
.SH SYNOPSIS
.nf
.B #define _XOPEN_SOURCE
.br
.B #include <stdlib.h>
.sp
.BI "char *ptsname(int " fd ");"
.fi
.SH DESCRIPTION
The
.BR ptsname ()
function returns the name of the slave pseudo-terminal device (pty)
corresponding to the master pty referred to by
.IR fd .
.SH "RETURN VALUE"
When successful,
.BR ptsname ()
returns a pointer to a string in static storage. This pointer
must not be freed.
.PP
Upon failure,
.BR ptsname ()
returns a NULL pointer.
.SH "CONFORMING TO"
POSIX 1003.1-2001.
This is part of the Unix98 pty support, see
.BR pts (4).
.SH "SEE ALSO"
.BR grantpt (3),
.BR ttyname (3),
.BR pts (4)