This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: XITE under CYGWIN gives pty errors
- From: Brian Dessent <brian at dessent dot net>
- To: cygwin <cygwin at cygwin dot com>
- Date: Sun, 14 Mar 2004 17:27:49 -0800
- Subject: Re: XITE under CYGWIN gives pty errors
- Organization: My own little world...
- References: <003c01c409d8$d20ed5b0$6501a8c0@AMD2000>
- Reply-to: cygwin at cygwin dot com
Rob van Aarle wrote:
> with these relevant comments:
> 'XptyStartProgram' allocates a pty (pseudo terminal) (either
> by calling system function '_getpty' (if source is compiled
> with GETPTY defined)) or by trying to open devices /dev/ptyxy
> (master) and /dev/ttyxy (slave) (where "x" is one of the
> characters "pqrstuvwxyz", "y" is one of the characters
> "0123456789abcdef").
This is the old traditional BSD way of allocating ptys. However, I
believe that Cygwin only supports the newer Unix98 method. Instead of
searching for a free device, you just open /dev/ptmx and you are
assigned a file descriptor for the master. Then you call ptsname() to
get the pathname of the slave, and then open it.
I'm sure if you do a little googling (or searching through Cygwin
sources for e.g. rxvt or xterm) you can find some code snippets of how
this is done.
Brian
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/