ioctl problem with pconsole

Chuck Cox chuck@chezcox.net
Tue Mar 22 00:01:00 GMT 2011


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?


Thanks,
Chuck
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pconsole.c
URL: <http://cygwin.com/pipermail/cygwin/attachments/20110322/6c51c07c/attachment.c>
-------------- next part --------------
--
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


More information about the Cygwin mailing list