1GRANTPT(3P)                POSIX Programmer's Manual               GRANTPT(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       grantpt - grant access to the slave pseudo-terminal device
13

SYNOPSIS

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

DESCRIPTION

21       The grantpt() function shall change the mode and ownership of the slave
22       pseudo-terminal device associated with its master pseudo-terminal coun‐
23       terpart. The fildes argument is a file descriptor that refers to a mas‐
24       ter  pseudo-terminal  device.  The user ID of the slave shall be set to
25       the real UID of the calling process and the group ID shall be set to an
26       unspecified group ID.  The permission mode of the slave pseudo-terminal
27       shall be set to readable and writable by the owner, and writable by the
28       group.
29
30       The  behavior  of the grantpt() function is unspecified if the applica‐
31       tion has installed a signal handler to catch SIGCHLD signals.
32

RETURN VALUE

34       Upon successful completion, grantpt() shall  return  0;  otherwise,  it
35       shall return -1 and set errno to indicate the error.
36

ERRORS

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

EXAMPLES

52       None.
53

APPLICATION USAGE

55       None.
56

RATIONALE

58       None.
59

FUTURE DIRECTIONS

61       None.
62

SEE ALSO

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