From: sheikyy AT spartan DOT pei DOT edu (Sheik) Subject: Re: probs porting ssh 18 Feb 1997 17:30:53 -0800 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Original-To: Martin Hamilton Original-cc: gnu-win32 AT cygnus DOT com In-Reply-To: <199702181531.PAA00819@gizmo.lut.ac.uk> Original-Sender: owner-gnu-win32 AT cygnus DOT com On Tue, 18 Feb 1997, Martin Hamilton wrote: > > I've hacked it around at bit - you can grab the source for my initial > attempt, which is just hacking around the problem areas and not a > serious attempt to "port" (no #ifdefs, for instance) at ftp.net.lut.ac.uk/martin/ssh-win32> I am gonna check it out right now. =) actually, I have another question about it tho, I did some debugging on the problem areas, and I have come across something I would like to get clarified (and maybe a workaround?) It appears that what ssh does is add the stdin fd to its fd_set's (readables) for select()'ing on. And when it does that, select() errors out, so, one of my questions is, how do I go about having ssh go into an indefinate select(), and still detect when input is ready from stdin? What I was going to do, was cheat, and make a timeout for the select(), and just simply check stdin each time select() times out, (I have NO idea if this is good or bad, or will cause cpu usage to go sky high, I just wanted to see if it worked) it *does* timeout, and goes into a check against stdin by read()'ing the fd. NOW I have another prob =) it seems that the default way that ssh puts for setting up blocking/non-blocking is *wrong*, so I mucked around with it, trying different ways to get our sockets to set up for blocking/nonblocking (yes, I know, winsock hates blocking sockets, but I was hoping for a quick port, and not have to create threads, blah blah blah) So, the socket is in blocking mode, and the read() sits there forever. So, to make a long story short =) what is the *correct* way to set up a socket for blocking/non-blocking for gcc-win32? (I have seen a few different ways, SYS5, BSD) Once I know this, I will be able to continue doing ports of my favorite net programs =) Thanks for any help, Scott Kilau - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".