Index of Section 2 Manual Pages
| Interix / SUA | ptsname_r.2 | Interix / SUA |
ptsname_r(2) ptsname_r(2)
ptsname()
NAME
ptsname(), ptsname_r() - get name of subordinate (slave) pseudo-terminal
device
SYNOPSIS
#include
char * ptsname(int fildes)
int ptsname_r (int filedes, char *buf, size_t len)
DESCRIPTION
The ptsname(2) call returns the name of a subordinate (also called slave)
pty that corresponds to the master pseudo-terminal device indicated by
fildes. This call is normally used after opening /dev/ptmx.
The format of the subordinate name is /dev/tty[pqrs]0-9a-f].
The ptsname_r(2) function is similar to ptsname(2) except that it places
its result into the buffer identified by the buf argument, the length of
which is specified by the len argument.
RETURN VALUE
On success, ptsname(2) returns a pointer to a string which is the name of
the subordinate pseudo terminal. On failure, it returns NULL. (It fails if
fildes can't be associated with the master side of a valid pseudo
terminal.)
On success, ptsname_r(2) returns zero; otherwise it returns nonzero.
SEE ALSO
grantpt(2)
open(2)
ttyname(2)
unlockpt(2)
pty(4)
termios(4)
tty(4)
USAGE NOTES
The ptsname_r function is thread safe. The ptsname function is not thread
safe.
None of these functions are async-signal safe.