1GRANTPT(P)                 POSIX Programmer's Manual                GRANTPT(P)
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 shall change the mode and ownership of the slave
16       pseudo-terminal device associated with its master pseudo-terminal coun‐
17       terpart. The fildes argument is a file descriptor that refers to a mas‐
18       ter pseudo-terminal device. The user ID of the slave shall  be  set  to
19       the real UID of the calling process and the group ID shall be set to an
20       unspecified group ID.  The permission mode of the slave pseudo-terminal
21       shall be set to readable and writable by the owner, and writable by the
22       group.
23
24       The behavior of the grantpt() function is unspecified if  the  applica‐
25       tion has installed a signal handler to catch SIGCHLD signals.
26

RETURN VALUE

28       Upon  successful  completion,  grantpt()  shall return 0; otherwise, it
29       shall return -1 and set errno to indicate the error.
30

ERRORS

32       The grantpt() function may fail if:
33
34       EBADF  The fildes argument is not a valid open file descriptor.
35
36       EINVAL The fildes argument is not associated with a master  pseudo-ter‐
37              minal device.
38
39       EACCES The  corresponding  slave  pseudo-terminal  device  could not be
40              accessed.
41
42
43       The following sections are informative.
44

EXAMPLES

46       None.
47

APPLICATION USAGE

49       None.
50

RATIONALE

52       None.
53

FUTURE DIRECTIONS

55       None.
56

SEE ALSO

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