Print this page
14249 pseudo-terminal nomenclature should reflect POSIX
Change-Id: Ib4a3cef899ff4c71b09cb0dc6878863c5e8357bc
*** 1,62 ****
GRANTPT(3C) Standard C Library Functions GRANTPT(3C)
NAME
! grantpt - grant access to the slave pseudo-terminal device
SYNOPSIS
#include <stdlib.h>
! int grantpt(int fildes);
-
DESCRIPTION
! The grantpt() function changes the mode and ownership of the slave
! pseudo-terminal device associated with its master pseudo-terminal
! counterpart. fildes is the file descriptor returned from a successful
! open of the master pseudo-terminal device. The user ID of the slave is
! set to the real UID of the calling process and the group ID is set to a
! reserved group. The permission mode of the slave pseudo-terminal is set
! to readable and writable by the owner and writable by the group.
! RETURN VALUES
! Upon successful completion, grantpt() returns 0. Otherwise, it returns
! -1 and sets errno to indicate the error.
! ERRORS
! The 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 master pseudo-
! terminal device.
! EACCES
! The corresponding slave pseudo-terminal device could not be
! accessed.
! ATTRIBUTES
! See attributes(5) for descriptions of the following attributes:
-
- +--------------------+-----------------+
- | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
- +--------------------+-----------------+
- |Interface Stability | Standard |
- +--------------------+-----------------+
- |MT-Level | Safe |
- +--------------------+-----------------+
-
SEE ALSO
! open(2), ptsname(3C), unlockpt(3C), attributes(5), standards(5)
!
! STREAMS Programming Guide
!
! August 14, 2006 GRANTPT(3C)
--- 1,57 ----
GRANTPT(3C) Standard C Library Functions GRANTPT(3C)
NAME
! grantpt - grant access to the subsidiary device of a pseudo-terminal
SYNOPSIS
#include <stdlib.h>
! int
! grantpt(int fildes);
DESCRIPTION
! The grantpt() function changes the mode and ownership of the pseudo-
! terminal subsidiary device associated with its pseudo-terminal manager
! counterpart.
! The fildes 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(7D) device.
! 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.
+ RETURN VALUES
+ The grantpt() function returns the value 0 if successful; otherwise the
+ value -1 is returned and the global variable errno is set to indicate the
+ error.
! EXAMPLES
! See posix_openpt(3C) for an example that includes a call to grantpt().
+ ERRORS
+ The 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), posix_openpt(3C), ptsname(3C), unlockpt(3C), attributes(5),
! standards(5), ptm(7D)
! illumos February 5, 2022 illumos