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.
70 For an explanation of the terms used in this section, see
76 Interface Attribute Value
81 T} Thread safety MT-Safe locale
89 This is part of the UNIX 98 pseudoterminal support, see
92 Historical systems implemented this function via a set-user-ID helper binary
94 glibc on Linux before glibc 2.33 could do so as well,
95 in order to support configurations with only BSD pseudoterminals;
96 this support has been removed.
97 On modern systems this is either a no-op
98 \[em]with permissions configured on pty allocation, as is the case on Linux\[em]
103 .BR posix_openpt (3),