diff -ur screen-4.0.2/misc.c screen-4.0.2-cyg/misc.c
--- screen-4.0.2/misc.c	2003-12-05 05:45:41.000000000 -0800
+++ screen-4.0.2-cyg/misc.c	2004-12-25 02:59:10.667806000 -0800
@@ -613,11 +613,11 @@
    */
 # endif /* NEEDSETENV */
 #else /* USESETENV */
-# if defined(linux) || defined(__convex__) || (BSD >= 199103)
+# if defined(linux) || defined(__convex__) || (BSD >= 199103) || defined(__CYGWIN__)
   setenv(var, value, 1);
 # else
   setenv(var, value);
-# endif /* linux || convex || BSD >= 199103 */
+# endif /* linux || convex || BSD >= 199103 || CYGWIN */
 #endif /* USESETENV */
 }
 
diff -ur screen-4.0.2/pty.c screen-4.0.2-cyg/pty.c
--- screen-4.0.2/pty.c	2003-09-08 07:26:18.000000000 -0700
+++ screen-4.0.2-cyg/pty.c	2004-12-25 04:15:08.892211000 -0800
@@ -34,8 +34,10 @@
 #endif
 
 /* for solaris 2.1, Unixware (SVR4.2) and possibly others */
-#ifdef HAVE_SVR4_PTYS
-# include <sys/stropts.h>
+#ifndef __CYGWIN__
+# ifdef HAVE_SVR4_PTYS
+#  include <sys/stropts.h>
+# endif
 #endif
 
 #if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL)
diff -ur screen-4.0.2/utmp.c screen-4.0.2-cyg/utmp.c
--- screen-4.0.2/utmp.c	2003-09-08 07:27:17.000000000 -0700
+++ screen-4.0.2-cyg/utmp.c	2004-12-25 04:13:26.625158000 -0800
@@ -102,11 +102,13 @@
 #endif
 
 
-# if defined(GETUTENT) && (!defined(SVR4) || defined(__hpux))
+# if defined(GETUTENT) && (!defined(SVR4) || defined(__hpux)) || !defined(__CYGWIN__)
 #  if defined(hpux) /* cruel hpux release 8.0 */
 #   define pututline _pututline
 #  endif /* hpux */
+# ifndef __CYGWIN__
 extern struct utmp *getutline(), *pututline();
+# endif /* CYGWIN */
 #  if defined(_SEQUENT_)
 extern struct utmp *ut_add_user(), *ut_delete_user();
 extern char *ut_find_host();
@@ -581,7 +583,11 @@
     }
 #endif
   setutent();
+#ifdef __CYGWIN__
+  return 1;
+#else
   return pututline(u) != 0;
+#endif /* CYGWIN */
 }
 
 static void
@@ -589,7 +595,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
