diff -bur screen-3.9.8/Makefile.in patched/Makefile.in
--- screen-3.9.8/Makefile.in	Fri Sep  1 18:07:26 2000
+++ patched/Makefile.in	Wed Nov 22 18:52:00 2000
@@ -68,14 +68,10 @@
 	$(CC) -c -I. -I$(srcdir) $(M_CFLAGS) $(DEFS) $(OPTIONS) $(CFLAGS) $<
 
 install_bin: .version screen
-	-if [ -f $(bindir)/$(SCREEN) ] && [ ! -f $(bindir)/$(SCREEN).old ]; \
-		then mv $(bindir)/$(SCREEN) $(bindir)/$(SCREEN).old; fi
-	$(INSTALL_PROGRAM) screen $(bindir)/$(SCREEN)
-	-chown root $(bindir)/$(SCREEN) && chmod 4755 $(bindir)/$(SCREEN)
-# This doesn't work if $(bindir)/screen is a symlink
-	-if [ -f $(bindir)/screen ] && [ ! -f $(bindir)/screen.old ]; then mv $(bindir)/screen $(bindir)/screen.old; fi
-	rm -f $(bindir)/screen
-	ln -s $(SCREEN) $(bindir)/screen
+	-if [ -f $(bindir)/screen.exe ] && [ ! -f $(bindir)/screen.old.exe ]; \
+		then mv $(bindir)/screen.exe $(bindir)/screen.old.exe; fi
+	$(INSTALL_PROGRAM) screen $(bindir)/screen
+	/usr/bin/touch /etc/ttys
 
 ###############################################################################
 install: installdirs install_bin
diff -bur screen-3.9.8/loadav.c patched/loadav.c
--- screen-3.9.8/loadav.c	Sun Jul  2 19:30:58 2000
+++ patched/loadav.c	Wed Nov 22 18:49:37 2000
@@ -56,7 +56,7 @@
 
 /***************************************************************/
 
-#if defined(linux) && !defined(LOADAV_DONE)
+#if (defined(__CYGWIN__) || defined(linux)) && !defined(LOADAV_DONE)
 #define LOADAV_DONE
 /*
  * This is the easy way. It relies in /proc being mounted.
diff -bur screen-3.9.8/misc.c patched/misc.c
--- screen-3.9.8/misc.c	Sun Jul  2 19:31:07 2000
+++ patched/misc.c	Wed Nov 22 18:49:37 2000
@@ -638,7 +638,7 @@
    */
 # endif /* NEEDSETENV */
 #else /* USESETENV */
-# if defined(linux) || defined(__convex__) || (BSD >= 199103)
+# if defined(__CYGWIN__) || defined(linux) || defined(__convex__) || (BSD >= 199103)
   setenv(var, value, 0);
 # else
   setenv(var, value);
@@ -821,7 +821,7 @@
   return 0;
 }
 
-# ifdef linux
+# if defined(linux) || defined(__CYGWIN__)
 
 /* stupid stupid linux ncurses! It won't to padding with
  * zeros but sleeps instead. This breaks CalcCost, of course.
diff -bur screen-3.9.8/os.h patched/os.h
--- screen-3.9.8/os.h	Wed Aug 30 14:00:10 2000
+++ patched/os.h	Wed Nov 22 18:49:37 2000
@@ -67,7 +67,7 @@
 # undef exit
 #endif /* sun */
 
-#ifndef linux /* all done in <errno.h> */
+#if !defined(__CYGWIN__) && !defined(linux) /* all done in <errno.h> */
 extern int errno;
 #endif /* linux */
 #ifndef HAVE_STRERROR
@@ -75,7 +75,7 @@
 #undef strerror
 #endif
 
-#if !defined(SYSV) && !defined(linux)
+#if !defined(SYSV) && (!defined(linux) || !defined(__CYGWIN__))
 # ifdef NEWSOS
 #  define strlen ___strlen___
 #  include <strings.h>
@@ -240,7 +240,7 @@
 #endif
 
 /* linux ncurses is broken, we have to use our own tputs */
-#if defined(linux) && defined(TERMINFO)
+#if (defined(__CYGWIN__) || defined(linux)) && defined(TERMINFO)
 # define tputs xtputs
 #endif
 
@@ -411,7 +411,7 @@
 #endif
 
 /* Geeeee, reverse it? */
-#if defined(SVR4) || (defined(SYSV) && defined(ISC)) || defined(_AIX) || defined(linux) || defined(ultrix) || defined(__386BSD__) || defined(__bsdi__) || defined(POSIX) || defined(NeXT)
+#if defined(SVR4) || (defined(SYSV) && defined(ISC)) || defined(_AIX) || defined(linux) || defined(ultrix) || defined(__386BSD__) || defined(__bsdi__) || defined(POSIX) || defined(NeXT) || defined(__CYGWIN__)
 # define SIGHASARG
 #endif
 
diff -bur screen-3.9.8/osdef.sh patched/osdef.sh
--- screen-3.9.8/osdef.sh	Sat Oct 16 17:12:37 1999
+++ patched/osdef.sh	Wed Nov 22 18:49:37 2000
@@ -24,7 +24,7 @@
 #ifndef sun
 #include <sys/ioctl.h>
 #endif
-#ifdef linux
+#if defined(linux) || defined(__CYGWIN__)
 #include <string.h>
 #include <stdlib.h>
 #endif
diff -bur screen-3.9.8/pty.c patched/pty.c
--- screen-3.9.8/pty.c	Sun Jul  2 19:31:22 2000
+++ patched/pty.c	Wed Nov 22 18:49:37 2000
@@ -38,7 +38,9 @@
 
 /* for solaris 2.1, Unixware (SVR4.2) and possibly others */
 #ifdef HAVE_SVR4_PTYS
+#ifndef __CYGWIN__
 # include <sys/stropts.h>
+#endif	/* no Cygwin */
 #endif
 
 #if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL)
@@ -126,7 +128,7 @@
 {
   if (f < 0)
     return;
-#if defined(I_PUSH) && defined(HAVE_SVR4_PTYS) && !defined(sgi) && !defined(linux) && !defined(__osf__) && !defined(M_UNIX)
+#if defined(I_PUSH) && defined(HAVE_SVR4_PTYS) && !defined(sgi) && !defined(linux) && !defined(__osf__) && !defined(M_UNIX) && !defined(__CYGWIN__)
   if (ioctl(f, I_PUSH, "ptem"))
     Panic(errno, "InitPTY: cannot I_PUSH ptem");
   if (ioctl(f, I_PUSH, "ldterm"))
diff -bur screen-3.9.8/screen.c patched/screen.c
--- screen-3.9.8/screen.c	Fri Sep  1 14:29:36 2000
+++ patched/screen.c	Wed Nov 22 18:49:37 2000
@@ -305,7 +305,7 @@
 #endif
   if (n < 13)
     ppp->pw_passwd = 0;
-#ifdef linux
+#if defined(linux) || defined(__CYGWIN__)
   if (ppp->pw_passwd && strlen(ppp->pw_passwd) == 13 + 11)
     ppp->pw_passwd[13] = 0;	/* beware of linux's long passwords */
 #endif
@@ -919,8 +919,10 @@
 	      n = (eff_uid == 0 && (real_uid || (st.st_mode & 0775) != 0775)) ? 0755 :
 	          (eff_gid == st.st_gid && eff_gid != real_gid) ? 0775 :
 		  0777;
+#ifndef __CYGWIN__
 	      if ((st.st_mode & 0777) != n)
 		Panic(0, "Directory '%s' must have mode %03o.", SockDir, n);
+#endif	/* no Cygwin */
 	    }
 	  sprintf(SockPath, "%s/S-%s", SockDir, LoginName);
 	  if (access(SockPath, F_OK))
@@ -950,8 +952,10 @@
       if (st.st_uid != real_uid)
 	Panic(0, "You are not the owner of %s.", SockPath);
     }
+#ifndef __CYGWIN__
   if ((st.st_mode & 0777) != 0700)
     Panic(0, "Directory %s must have mode 700.", SockPath);
+#endif	/* no Cygwin */
   SockName = SockPath + strlen(SockPath) + 1;
   *SockName = 0;
   (void) umask(oumask);
diff -bur screen-3.9.8/tty.c.dist patched/tty.c.dist
--- screen-3.9.8/tty.c.dist	Fri Sep  1 18:06:58 2000
+++ patched/tty.c.dist	Wed Nov 22 18:49:37 2000
@@ -176,7 +176,7 @@
 #endif
   SetTTY(f, &Mode);
 
-#if defined(linux) && defined(TIOCMSET)
+#if (defined(linux) || defined(__CYGWIN__)) && defined(TIOCMSET)
   {
     int mcs = 0;
     ioctl(f, TIOCMGET, &mcs);
diff -bur screen-3.9.8/tty.sh patched/tty.sh
--- screen-3.9.8/tty.sh	Fri Sep  1 18:06:48 2000
+++ patched/tty.sh	Wed Nov 22 18:49:37 2000
@@ -202,7 +202,7 @@
 #endif
   SetTTY(f, &Mode);
 
-#if defined(linux) && defined(TIOCMSET)
+#if (defined(linux) || defined(__CYGWIN__)) && defined(TIOCMSET)
   {
     int mcs = 0;
     ioctl(f, TIOCMGET, &mcs);
diff -bur screen-3.9.8/utmp.c patched/utmp.c
--- screen-3.9.8/utmp.c	Wed Aug 30 13:57:42 2000
+++ patched/utmp.c	Wed Nov 22 18:49:37 2000
@@ -46,7 +46,6 @@
 extern char *LoginName;
 extern int real_uid, eff_uid;
 
-
 /*
  *  UTNOKEEP: A (ugly) hack for apollo that does two things:
  *    1) Always close and reopen the utmp file descriptor. (I don't know
@@ -93,7 +92,7 @@
 static int  initutmp __P((void));
 static void setutent __P((void));
 #endif
-#if defined(linux) && defined(GETUTENT)
+#if (defined(__CYGWIN__) || defined(linux)) && defined(GETUTENT)
 static struct utmp *xpututline __P((struct utmp *utmp));
 # define pututline xpututline
 #endif
@@ -591,7 +590,7 @@
 struct utmp *u;
 {
   u->ut_type = DEAD_PROCESS;
-#if !defined(linux) || defined(EMPTY)
+#if (!defined(linux) && !defined(__CYGWIN__)) || defined(EMPTY)
   u->ut_exit.e_termination = 0;
   u->ut_exit.e_exit = 0;
 #endif
@@ -609,7 +608,7 @@
   u->ut_type = USER_PROCESS;
   strncpy(u->ut_user, user, sizeof(u->ut_user));
   /* Now the tricky part... guess ut_id */
-#if defined(sgi) || defined(linux)
+#if defined(sgi) || defined(linux) || defined(__CYGWIN__)
   strncpy(u->ut_id, line + 3, sizeof(u->ut_id));
 #else /* sgi */
 # ifdef _IBMR2
@@ -860,7 +859,7 @@
 }
 # endif /* BUGGYGETLOGIN */
 
-#if defined(linux) && defined(GETUTENT)
+#if (defined(__CYGWIN__) || defined(linux)) && defined(GETUTENT)
 # undef pututline
 
 /* aargh, linux' pututline returns void! */
diff -bur screen-3.9.8/window.c patched/window.c
--- screen-3.9.8/window.c	Mon Jul 10 11:59:58 2000
+++ patched/window.c	Wed Nov 22 18:49:37 2000
@@ -1029,7 +1029,7 @@
     }
   debug1("fcntl(%d, F_SETFL, FNBLOCK)\n", f);
   (void) fcntl(f, F_SETFL, FNBLOCK);
-#ifdef linux
+#if defined(__CYGWIN__) || defined(linux)
   /*
    * Tenebreux (zeus@ns.acadiacom.net) has Linux 1.3.70 where select
    * gets confused in the following condition:
