1 UNLOCKPT(3C)             Standard C Library Functions             UNLOCKPT(3C)
   2 
   3 NAME
   4      unlockpt - unlock a pseudo-terminal device pair
   5 
   6 SYNOPSIS
   7      #include <stdlib.h>
   8 
   9      int
  10      unlockpt(int fildes);
  11 
  12 DESCRIPTION
  13      When a pseudo-terminal manager device is opened, whether through
  14      posix_openpt(3C) or open(2) on a ptm(7D) device, the subsidiary device
  15      begins operation in a locked state.  The unlockpt() function unlocks the
  16      pseudo-terminal subsidiary device associated with the manager device to
  17      which fildes refers.
  18 
  19      Portable applications must call unlockpt() before opening the pseudo-
  20      terminal subsidiary device.
  21 
  22 RETURN VALUES
  23      The unlockpt() function returns the value 0 if successful; otherwise the
  24      value -1 is returned and the global variable errno is set to indicate the
  25      error.
  26 
  27 EXAMPLES
  28      See posix_openpt(3C) for an example that includes a call to unlockpt().
  29 
  30 ERRORS
  31      The unlockpt() function may fail if:
  32 
  33      EBADF              The fildes argument is not a file descriptor open for
  34                         writing.
  35 
  36      EINVAL             EINVAL The fildes argument is not associated with a
  37                         pseudo-terminal manager device.
  38 
  39 INTERFACE STABILITY
  40      Committed
  41 
  42 MT LEVEL
  43      Safe
  44 
  45 SEE ALSO
  46      open(2), grantpt(3C), posix_openpt(3C), ptsname(3C), attributes(5),
  47      standards(5), ptm(7D)
  48 
  49 illumos                        February 5, 2022                        illumos