Standard C Library Functions ptsname(3C)
NAME
ptsname - get name of the slave pseudo-terminal device
SYNOPSIS
#include
char *ptsname(int fildes);
DESCRIPTION
The ptsname() function returns the name of the slave
pseudo-terminal device associated with a master pseudo-
terminal device. fildes is a file descriptor returned from asuccessful open of the master device. ptsname() returns a
pointer to a string containing the null-terminated path name
of the slave device of the form /dev/pts/N, where N is a
non-negative integer.
RETURN VALUES
Upon successful completion, the function ptsname() returns a
pointer to a string which is the name of the pseudo-terminal
slave device. This value points to a static data area thatis overwritten by each call to ptsname(). Upon failure,
ptsname() returns NULL. This could occur if fildes is an
invalid file descriptor or if the slave device name does not exist in the file system.ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Interface Stability | Committed ||_____________________________|_____________________________|
| MT-Level | Safe |
|_____________________________|_____________________________|
| Standard | See standards(5). ||_____________________________|_____________________________|
SEE ALSO
open(2), grantpt(3C), ttyname(3C), unlockpt(3C), attri-
butes(5), standards(5) STREAMS Programming GuideSunOS 5.11 Last change: 14 Aug 2002 1