__getpt ()
__getpt (void)
__getpt (){  int fd;  const char *i, *j;  static int have_dev_ptmx = 1;  char namebuf[PTYNAMELEN];  /* The new way:  */  if (have_dev_ptmx)    {      fd = __open ("/dev/ptmx", O_RDWR);      if (fd != -1)	return fd;      else	{	  if (errno == ENOENT || errno == ENODEV)	    have_dev_ptmx = 0;	  else	    return -1;	}    }  /* The old way: */  strcpy (namebuf, "/dev/pty");  namebuf[10] = '\0';  for (i = __ptyname1; *i; ++i)    {      namebuf[8] = *i;      for (j = __ptyname2; *j; ++j)        {	  namebuf[9] = *j;	  fd = __open (namebuf, O_RDWR);	  if (fd != -1)	    return fd;	  if (errno != EIO)	    return -1;        }    }  __set_errno (ENFILE);  return -1;}