Subject: Re: How to create tty/pty pair ?
From: Christopher Faylor <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Thu, 4 Jan 2001 17:41:26 -0500

On Sat, Dec 30, 2000 at 11:19:17PM +0200, Ehud Karni wrote:
>I do not know how to make a tty/pty pair with Cygwin.

/dev/ptmx is the mechanism.  Here is some sample code:

    char *slave;
    int om = open ("/dev/ptmx", O_RDWR);
    if (om < 0)
      die ("/dev/ptmx", 1);

    if (grantpt (om) < 0)
      die ("grantpt", 2);

    if (unlockpt (om) < 0)
      die ("unlockpt", 3);

    slave = ptsname (om);
    if (slave == NULL)
      die ("ptsname", 4);

cgf

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple