GRANTPT(3C) Standard C Library Functions GRANTPT(3C)
- grant access to the subsidiary device of a pseudo-terminal
SYNOPSIS #include <stdlib.h> int grantpt
() function changes the mode and ownership of the pseudo-
terminal subsidiary device associated with its pseudo-terminal manager
argument is the file descriptor returned from a successful open(2)
of the pseudo-terminal manager device; e.g., by calling posix_openpt(3C)
or by performing an open(2)
of the ptm(4D)
The user ID owner of the subsidiary device is set to the real user ID of
the calling process. The group ID owner is set to a reserved group.
The permission mode of the subsidiary device is set to be readable and
writable by the owner, and writable by the group.
() function returns the value 0 if successful; otherwise the
value -1 is returned and the global variable errno
is set to indicate the
for an example that includes a call to grantpt
() function may fail if:
EBADF The fildes
argument is not a valid open file descriptor.
EINVAL The fildes
argument is not associated with a pseudo-
terminal manager device.
EACCES The corresponding pseudo-terminal subsidiary device
could not be accessed.
INTERFACE STABILITY Committed
MT LEVEL Safe
SEE ALSO open(2)
OmniOS February 5, 2022 OmniOS