delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/03/14/20:28:20

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <40550695.381F42A@dessent.net>
Date: Sun, 14 Mar 2004 17:27:49 -0800
From: Brian Dessent <brian AT dessent DOT net>
Organization: My own little world...
MIME-Version: 1.0
To: cygwin <cygwin AT cygwin DOT com>
Subject: Re: XITE under CYGWIN gives pty errors
References: <003c01c409d8$d20ed5b0$6501a8c0 AT AMD2000>
X-IsSubscribed: yes
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019