ptsname - get name of the slave pseudo-terminal device
#include <stdlib.h> char *ptsname(int fildes);
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.
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.
No errors are defined.
None.
The value returned may point to a static data area that is overwritten by each call to ptsname().
None.
grantpt(), open(), ttyname(), unlockpt(), <stdlib.h>.