NAME
ptsname — get name
of the slave pseudo-terminal device
SYNOPSIS
#include <stdlib.h> char *ptsname(int fildes);
DESCRIPTION
The ptsname() function returns the name of the slave pseudo-terminal device associated with a master pseudo-terminal device. The fildes argument is a file descriptor that refers to the master device. The ptsname() function returns a pointer to a string containing the pathname of the corresponding slave device.
This interface need not be reentrant.
RETURN VALUE
Upon successful completion, ptsname() returns a pointer to a string which is the name of the pseudo-terminal slave device. Upon failure, ptsname() returns a null pointer. This could occur if fildes is an invalid file descriptor or if the slave device name does not exist in the file system.
ERRORS
No errors are defined.
EXAMPLES
None.
APPLICATION USAGE
The value returned may point to a static data area that is overwritten by each call to ptsname() .
FUTURE DIRECTIONS
None.
SEE ALSO
grantpt(3) , open(3) , ttyname(3) , unlockpt(3) , <stdlib.h> .