Print this page
14249 pseudo-terminal nomenclature should reflect POSIX
Change-Id: Ib4a3cef899ff4c71b09cb0dc6878863c5e8357bc
   1 GRANTPT(3C)              Standard C Library Functions              GRANTPT(3C)
   2 
   3 NAME
   4        grantpt - grant access to the slave pseudo-terminal device
   5 
   6 SYNOPSIS
   7        #include <stdlib.h>
   8 
   9        int grantpt(int fildes);

  10 
  11 
  12 DESCRIPTION
  13        The grantpt() function changes the mode and ownership of the slave
  14        pseudo-terminal device associated with its master  pseudo-terminal
  15        counterpart.  fildes is the file descriptor returned from a successful
  16        open of the master pseudo-terminal device. The user ID of the slave is
  17        set to the real UID of the calling process and the group ID is set to a
  18        reserved group. The permission mode of the slave pseudo-terminal is set
  19        to readable and writable by the owner and writable by the group.
  20 
  21 RETURN VALUES
  22        Upon successful completion, grantpt() returns 0. Otherwise, it returns
  23        -1 and sets errno to indicate the error.
  24 
  25 ERRORS
  26        The grantpt() function may fail if:
  27 
  28        EBADF
  29                  The fildes argument is not a valid open file descriptor.
  30 




  31 
  32        EINVAL
  33                  The fildes argument is not associated with a master pseudo-
  34                  terminal device.
  35 


  36 
  37        EACCES
  38                  The corresponding slave pseudo-terminal device could not be
  39                  accessed.
  40 


  41 
  42 ATTRIBUTES
  43        See attributes(5) for descriptions of the following attributes:
  44 


  45 


  46 
  47 
  48        +--------------------+-----------------+
  49        |  ATTRIBUTE TYPE    | ATTRIBUTE VALUE |
  50        +--------------------+-----------------+
  51        |Interface Stability | Standard        |
  52        +--------------------+-----------------+
  53        |MT-Level            | Safe            |
  54        +--------------------+-----------------+
  55 
  56 SEE ALSO
  57        open(2), ptsname(3C), unlockpt(3C), attributes(5), standards(5)

  58 
  59 
  60        STREAMS Programming Guide
  61 
  62                                 August 14, 2006                    GRANTPT(3C)
   1 GRANTPT(3C)              Standard C Library Functions              GRANTPT(3C)
   2 
   3 NAME
   4      grantpt - grant access to the subsidiary device of a pseudo-terminal
   5 
   6 SYNOPSIS
   7      #include <stdlib.h>
   8 
   9      int
  10      grantpt(int fildes);
  11 

  12 DESCRIPTION
  13      The grantpt() function changes the mode and ownership of the pseudo-
  14      terminal subsidiary device associated with its pseudo-terminal manager
  15      counterpart.




  16 
  17      The fildes argument is the file descriptor returned from a successful
  18      open(2) of the pseudo-terminal manager device; e.g., by calling
  19      posix_openpt(3C) or by performing an open(2) of the ptm(7D) device.
  20 
  21      The user ID owner of the subsidiary device is set to the real user ID of
  22      the calling process.  The group ID owner is set to a reserved group.
  23 
  24      The permission mode of the subsidiary device is set to be readable and
  25      writable by the owner, and writable by the group.
  26 
  27 RETURN VALUES
  28      The grantpt() function returns the value 0 if successful; otherwise the
  29      value -1 is returned and the global variable errno is set to indicate the
  30      error.
  31 
  32 EXAMPLES
  33      See posix_openpt(3C) for an example that includes a call to grantpt().

  34 
  35 ERRORS
  36      The grantpt() function may fail if:
  37 
  38      EBADF              The fildes argument is not a valid open file
  39                         descriptor.

  40 
  41      EINVAL             The fildes argument is not associated with a pseudo-
  42                         terminal manager device.
  43 
  44      EACCES             The corresponding pseudo-terminal subsidiary device
  45                         could not be accessed.
  46 
  47 INTERFACE STABILITY
  48      Committed
  49 
  50 MT LEVEL
  51      Safe
  52 









  53 SEE ALSO
  54      open(2), posix_openpt(3C), ptsname(3C), unlockpt(3C), attributes(5),
  55      standards(5), ptm(7D)
  56 
  57 illumos                        February 5, 2022                        illumos