The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 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(), open(), ttyname(), unlockpt(), <stdlib.h>.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]