1 .\" %%%LICENSE_START(PUBLIC_DOMAIN)
2 .\" This page is in the public domain. - aeb
5 .TH GRANTPT 3 2017-09-15 "GNU" "Linux Programmer's Manual"
7 grantpt \- grant access to the slave pseudoterminal
11 .BI "int grantpt(int " fd ");"
14 Feature Test Macro Requirements for glibc (see
15 .BR feature_test_macros (7)):
23 _XOPEN_SOURCE\ >=\ 500 ||
24 (_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED)
26 Glibc 2.23 and earlier:
33 function changes the mode and owner of the slave pseudoterminal device
34 corresponding to the master pseudoterminal referred to by
36 The user ID of the slave is set to the real UID of the calling process.
37 The group ID is set to an unspecified value (e.g.,
39 The mode of the slave is set to 0620 (crw\-\-w\-\-\-\-).
43 is unspecified if a signal handler is installed to catch
50 Otherwise, it returns \-1 and sets
56 The corresponding slave pseudoterminal could not be accessed.
61 argument is not a valid open file descriptor.
66 argument is valid but not associated with a master pseudoterminal.
69 is provided in glibc since version 2.1.
71 For an explanation of the terms used in this section, see
77 Interface Attribute Value
80 T} Thread safety MT-Safe locale
84 POSIX.1-2001, POSIX.1-2008.
86 This is part of the UNIX 98 pseudoterminal support, see
89 Many systems implement this function via a set-user-ID helper binary
91 On Linux systems with a devpts filesystem (present since Linux 2.2),
92 the kernel normally sets the correct ownership and permissions
93 for the pseudoterminal slave when the master is opened
94 .RB ( posix_openpt (3)),
95 so that nothing must be done by
97 Thus, no such helper binary is required
98 (and indeed it is configured to be absent during the
99 glibc build that is typical on many systems).
102 .BR posix_openpt (3),