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

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       ptsname - get name of the slave pseudo-terminal device
13

SYNOPSIS

15       #include <stdlib.h>
16
17       char *ptsname(int fildes);
18
19

DESCRIPTION

21       The ptsname() function shall return the name of the slave pseudo-termiā€
22       nal  device associated with a master pseudo-terminal device. The fildes
23       argument is a file descriptor that refers to  the  master  device.  The
24       ptsname()  function  shall  return a pointer to a string containing the
25       pathname of the corresponding slave device.
26
27       The ptsname() function need not be reentrant. A function  that  is  not
28       required to be reentrant is not required to be thread-safe.
29

RETURN VALUE

31       Upon  successful  completion,  ptsname()  shall  return  a pointer to a
32       string which is the name of  the  pseudo-terminal  slave  device.  Upon
33       failure,  ptsname()  shall  return a null pointer.  This could occur if
34       fildes is an invalid file descriptor or if the slave device  name  does
35       not exist in the file system.
36

ERRORS

38       No errors are defined.
39
40       The following sections are informative.
41

EXAMPLES

43       None.
44

APPLICATION USAGE

46       The  value returned may point to a static data area that is overwritten
47       by each call to ptsname().
48

RATIONALE

50       None.
51

FUTURE DIRECTIONS

53       None.
54

SEE ALSO

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