This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
Re: How to create tty/pty pair ?
- To: cygwin at cygwin dot com
- Subject: Re: How to create tty/pty pair ?
- From: Christopher Faylor <cgf at redhat dot com>
- Date: Thu, 4 Jan 2001 17:41:26 -0500
- Cc: ehud at unix dot simonwiesel dot co dot il
- References: <200012302119.XAA26674@linux.>
- Reply-To: cygwin at cygwin dot com
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