1PTSNAME(P)                 POSIX Programmer's Manual                PTSNAME(P)
2
3
4

NAME

6       ptsname - get name of the slave pseudo-terminal device
7

SYNOPSIS

9       #include <stdlib.h>
10
11       char *ptsname(int fildes);
12
13

DESCRIPTION

15       The ptsname() function shall return the name of the slave pseudo-termi‐
16       nal device associated with a master pseudo-terminal device. The  fildes
17       argument  is  a  file  descriptor that refers to the master device. The
18       ptsname() function shall return a pointer to a  string  containing  the
19       pathname of the corresponding slave device.
20
21       The  ptsname()  function  need not be reentrant. A function that is not
22       required to be reentrant is not required to be thread-safe.
23

RETURN VALUE

25       Upon successful completion, ptsname()  shall  return  a  pointer  to  a
26       string  which  is  the  name  of the pseudo-terminal slave device. Upon
27       failure, ptsname() shall return a null pointer.  This  could  occur  if
28       fildes  is  an invalid file descriptor or if the slave device name does
29       not exist in the file system.
30

ERRORS

32       No errors are defined.
33
34       The following sections are informative.
35

EXAMPLES

37       None.
38

APPLICATION USAGE

40       The value returned may point to a static data area that is  overwritten
41       by each call to ptsname().
42

RATIONALE

44       None.
45

FUTURE DIRECTIONS

47       None.
48

SEE ALSO

50       grantpt() , open() , ttyname() , unlockpt() , the Base Definitions vol‐
51       ume of IEEE Std 1003.1-2001, <stdlib.h>
52
54       Portions of this text are reprinted and reproduced in  electronic  form
55       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
56       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
57       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
58       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
59       event of any discrepancy between this version and the original IEEE and
60       The Open Group Standard, the original IEEE and The Open Group  Standard
61       is  the  referee document. The original Standard can be obtained online
62       at http://www.opengroup.org/unix/online.html .
63
64
65
66IEEE/The Open Group                  2003                           PTSNAME(P)
Impressum