Back to index

glibc  2.9
Functions
unlockpt.c File Reference
#include <errno.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <termios.h>

Go to the source code of this file.

Functions

int unlockpt (int fd)

Function Documentation

int unlockpt ( int  fd)

Definition at line 29 of file unlockpt.c.

{
#ifdef TIOCSPTLCK
  int save_errno = errno;
  int unlock = 0;

  if (__ioctl (fd, TIOCSPTLCK, &unlock))
    {
      if (errno == EINVAL)
       {
         __set_errno (save_errno);
         return 0;
       }
      else
       return -1;
    }
#endif
  /* If we have no TIOCSPTLCK ioctl, all slave pseudo terminals are
     unlocked by default.  */
  return 0;
}