1grantpt(3C)              Standard C Library Functions              grantpt(3C)
2
3
4

NAME

6       grantpt - grant access to the slave pseudo-terminal device
7

SYNOPSIS

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

DESCRIPTION

15       The  grantpt()  function  changes  the  mode and ownership of the slave
16       pseudo-terminal device  associated  with  its  master   pseudo-terminal
17       counterpart.  fildes  is the file descriptor returned from a successful
18       open of the master pseudo-terminal device. The user ID of the slave  is
19       set to the real UID of the calling process and the group ID is set to a
20       reserved group. The permission mode of the slave pseudo-terminal is set
21       to readable and writable by the owner and writable by the group.
22

RETURN VALUES

24       Upon  successful completion, grantpt() returns 0. Otherwise, it returns
25       −1 and sets errno to indicate the error.
26

ERRORS

28       The grantpt() function may fail if:
29
30       EBADF     The fildes argument is not a valid open file descriptor.
31
32
33       EINVAL    The fildes argument is not associated with a  master  pseudo-
34                 terminal device.
35
36
37       EACCES    The  corresponding  slave pseudo-terminal device could not be
38                 accessed.
39
40

ATTRIBUTES

42       See attributes(5) for descriptions of the following attributes:
43
44
45
46
47       ┌─────────────────────────────┬─────────────────────────────┐
48       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
49       ├─────────────────────────────┼─────────────────────────────┤
50       │Interface Stability          │Standard                     │
51       ├─────────────────────────────┼─────────────────────────────┤
52       │MT-Level                     │Safe                         │
53       └─────────────────────────────┴─────────────────────────────┘
54

SEE ALSO

56       open(2), ptsname(3C), unlockpt(3C), attributes(5), standards(5)
57
58
59       STREAMS Programming Guide
60
61
62
63SunOS 5.11                        14 Aug 2006                      grantpt(3C)
Impressum