ptsname(3C) DG/UX 5.4R3.00 ptsname(3C)
NAME
ptsname - get name of the slave pseudo-terminal device
SYNOPSIS
#include <stdio.h>
char *ptsname(int fildes);
DESCRIPTION
The function ptsname() returns the name of the slave pseudo-terminal
device associated with a master pseudo-terminal device. fildes is a
file descriptor returned from a successful open of the master device.
The behavior of ptsname() depends on the Pseudo-Terminal
Compatibility Mode currently in use. This mode is a DG/UX system
parameter, controllable using the sysadm(1m) command ( System ->
Parameters menu ) followed by rebooting the system. This mode has
two settings, as follows:
default With DG/UX in this mode, ptsname() returns a pointer to a
string containing the null-terminated path name of a slave
device of the form /dev/pts/N, where N is a decimal integer
from 1 to 5 characters in length. This mode is compatible
with the SVID, Third Edition.
BCS ptsname() returns a pointer to a string containing the
null-terminated path name of a slave device of the form
/dev/ptsN, where N is a decimal integer from 1 to 5
characters in length. Names of this form are required by
any pre-DG/UX 5.4.2 COFF applications (those built using
the m88kbcs and m88kocs SDEs and those built using the dgux
COFF SDE prior to 5.4.2) which contain a ttyname() function
that is incapable of finding Pseudo-Terminals under the
/dev/pts directory.
Considerations for Threads Programming
+---------+-----------------------------+
| | async- |
|function | reentrant cancel cancel |
| | point safe |
+---------+-----------------------------+
|ptsname | N - - |
+---------+-----------------------------+
RETURN VALUE
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 that is 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.
Licensed material--property of copyright holder(s) 1
ptsname(3C) DG/UX 5.4R3.00 ptsname(3C)
SEE ALSO
open(2), reentrant(3), grantpt(3C), ttyname(3C),
unlockpt(3C).
Programmer's Guide: STREAMS.
Managing the DG/UX System.
Licensed material--property of copyright holder(s) 2