2 .\" %%%LICENSE_START(PUBLIC_DOMAIN)
3 .\" This page is in the public domain. - aeb
6 .TH grantpt 3 (date) "Linux man-pages (unreleased)"
8 grantpt \- grant access to the slave pseudoterminal
11 .RI ( libc ", " \-lc )
14 .B #include <stdlib.h>
16 .BI "int grantpt(int " fd ");"
20 Feature Test Macro Requirements for glibc (see
21 .BR feature_test_macros (7)):
28 .\" || (_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED)
29 glibc 2.23 and earlier:
35 function changes the mode and owner of the slave pseudoterminal device
36 corresponding to the master pseudoterminal referred to by the file descriptor
38 The user ID of the slave is set to the real UID of the calling process.
39 The group ID is set to an unspecified value (e.g.,
41 The mode of the slave is set to 0620 (crw\-\-w\-\-\-\-).
45 is unspecified if a signal handler is installed to catch
52 Otherwise, it returns \-1 and sets
54 to indicate the error.
58 The corresponding slave pseudoterminal could not be accessed.
63 argument is not a valid open file descriptor.
68 argument is valid but not associated with a master pseudoterminal.
71 is provided since glibc 2.1.
73 For an explanation of the terms used in this section, see
81 Interface Attribute Value
84 T} Thread safety MT-Safe locale
90 POSIX.1-2001, POSIX.1-2008.
92 This is part of the UNIX 98 pseudoterminal support, see
95 Many systems implement this function via a set-user-ID helper binary
97 On Linux systems with a devpts filesystem (present since Linux 2.2),
98 the kernel normally sets the correct ownership and permissions
99 for the pseudoterminal slave when the master is opened
100 .RB ( posix_openpt (3)),
101 so that nothing must be done by
103 Thus, no such helper binary is required
104 (and indeed it is configured to be absent during the
105 glibc build that is typical on many systems).
108 .BR posix_openpt (3),