ptsname(S-osr5)
ptsname --
get name of the slave pseudo-terminal
Syntax
cc ...-lc
#include <stdlib.h>
char *ptsname(int fildes);
Description
ptsname(S-osr5)
returns the name of the slave pseudo-terminal device
for a master pseudo-terminal device.
fildes is a file descriptor returned from a successful open
of the master device.
ptsname( )
returns a pointer to a string containing the null-terminated path name
of the slave device.
The form of the name is
/dev/ptsN, where
N is a three-digit integer between 000 and 255.
Return values
On successful completion,
ptsname( )
returns a pointer to a string
that is the name of the slave pseudo-terminal device.
It points to a static data area that is overwritten by each call to
ptsname( ).
On failure,
ptsname( )
returns NULL.
This can happen if
fildes is an invalid file descriptor or if
the slave device name does not exist in the file system.
Diagnostics
This function does not set errno.
See also
grantpt(S-osr5),
open(S-osr5),
ttyname(S-osr5),
unlockpt(S-osr5)
Standards conformance
ptsname(S-osr5)
is conformant with:
X/Open CAE Specification, System Interfaces and Headers, Issue 4, Version 2.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005