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]

ioctl problem with pconsole


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

Attachment: pconsole.c
Description: Text document

--
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]