This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ioctl problem with pconsole


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]