delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/03/21/20:22:59

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY
X-Spam-Check-By: sourceware.org
X-Yahoo-SMTP: jenXL62swBAWhMTL3wnej93oaS0ClBQOAKs8jbEbx_o-
Date: Mon, 21 Mar 2011 20:22:21 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: ioctl problem with pconsole
Message-ID: <20110322002221.GB7812@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4D87D9A9 DOT 8080202 AT chezcox DOT net>
MIME-Version: 1.0
In-Reply-To: <4D87D9A9.8080202@chezcox.net>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

On Mon, Mar 21, 2011 at 05:05:13PM -0600, Chuck Cox wrote:
>I'm trying to compile pconsole (from http://www.heiho.net/pconsole/) on 
>Cygwin 1.7.8 with the standard gcc 4.3.4 compiler. I have compiled many 
>things before on Solaris and Linux, but this is my first adventure with 
>Cygwin.  :-)
>
>First off, you have to add "#define TIOCSTI 0x5412" to pconsole.c as 
>mentioned on the author's webpage above. I also commented out lines 
>186-189 of pconsole.c because it's checking to see if your euid is zero, 
>which doesn't really exist in Cygwin. It wants to be installed setuid 
>root on most UNIX flavors...
>
>With the euid check commented out, the pconsole.exe binary runs and will 
>attach to a tty, but as soon as you try to type something it detaches 
>and says "ioctl() : Invalid argument".
>
>There's only one call to ioctl() on line 162 of pconsole.c:
>	if (ioctl(c->fd, TIOCSTI, &kar) == -1) {
>
>I'm guessing that it's failing due to the way Cygwin implements ttys as 
>pipes and/or maybe the value of TIOCSTI given above just doesn't work on 
>Cygwin.
>
>Anyone have a suggestion here?

I don't have a suggestion but you can't just define TIOCSTI to some number
and hope that's right.  If we really implemented this ioctl then it would
actually be defined.  I'm not sure how defining it to 0x5412 would work
anywhere.

It's not impossible to implement TIOCSTI in Cygwin.  It's been asked for
before but no one has gotten around to implementing it.  The trick would
be implementing it for tty, console, and serial but it's still doable.

But none of that is particularly good news for you, I know.  :-(

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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