* GET PSEUDO TELETYPE - MASTER AND SLAVE *
* ------------------------------------------------------------------------- */
/*
- * Returns pty file descriptor, or -1 on failure
+ * Returns pty file descriptor, or -1 on failure
* If successful, ttydev is set to the name of the slave device.
* fd_tty _may_ also be set to an open fd to the slave device
*/
int pfd;
int res;
char tty_name[32];
-
+
res = openpty (&pfd, fd_tty, tty_name, NULL, NULL);
if (res != -1)
/*----------------------------------------------------------------------*/
/*
- * Returns tty file descriptor, or -1 on failure
+ * Returns tty file descriptor, or -1 on failure
*/
static int
get_tty (char *ttydev)
}
#endif
+#ifdef TIOCSCTTY
ioctl (fd_tty, TIOCSCTTY, NULL);
+#else
+ fd = open (name, O_RDWR);
+ if (fd >= 0)
+ close (fd);
+#endif
int fd = open ("/dev/tty", O_WRONLY);
if (fd < 0)