1ptsname(3C)              Standard C Library Functions              ptsname(3C)
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  returns the name of the slave pseudo-terminal
16       device associated with a master pseudo-terminal  device.  fildes  is  a
17       file  descriptor  returned from a successful open of the master device.
18       ptsname() returns a pointer to a string containing the  null-terminated
19       path name of the slave device of the form /dev/pts/N, where N is a non-
20       negative integer.
21

RETURN VALUES

23       Upon successful completion, the function ptsname() returns a pointer to
24       a  string  which  is the name of the pseudo-terminal slave device. This
25       value points to a static data area that is overwritten by each call  to
26       ptsname().  Upon  failure,  ptsname() returns NULL. This could occur if
27       fildes is an invalid file descriptor or if  the slave device name  does
28       not exist in the file system.
29

ATTRIBUTES

31       See attributes(5) for descriptions of the following attributes:
32
33
34
35
36       ┌─────────────────────────────┬─────────────────────────────┐
37       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
38       ├─────────────────────────────┼─────────────────────────────┤
39       │Interface Stability          │Standard                     │
40       ├─────────────────────────────┼─────────────────────────────┤
41       │MT-Level                     │Safe                         │
42       └─────────────────────────────┴─────────────────────────────┘
43

SEE ALSO

45       open(2),  grantpt(3C),  ttyname(3C), unlockpt(3C), attributes(5), stan‐
46       dards(5)
47
48
49       STREAMS Programming Guide
50
51
52
53SunOS 5.11                        14 Aug 2002                      ptsname(3C)
Impressum