Index: /trunk/openjdk/jdk/src/windows/native/java/io/Win32FileSystem_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/io/Win32FileSystem_md.c	(revision 85)
+++ /trunk/openjdk/jdk/src/windows/native/java/io/Win32FileSystem_md.c	(revision 86)
@@ -31,4 +31,8 @@
 #include <windows.h>
 #include <io.h>
+
+#ifdef __EMX__
+#include <string.h>
+#endif
 
 #include "jvm.h"
@@ -235,6 +239,6 @@
         modTime.LowPart = (DWORD) fd.ftLastWriteTime.dwLowDateTime;
         modTime.HighPart = (LONG) fd.ftLastWriteTime.dwHighDateTime;
-        rv = modTime.QuadPart / 10000;
-        rv -= 11644473600000;
+        rv = modTime.QuadPart / 10000LL;
+        rv -= 11644473600000LL;
     }
     } END_NATIVE_PATH(env, path);
@@ -249,8 +253,15 @@
 
     WITH_NATIVE_PATH(env, file, ids.path, path) {
+#ifdef __EMX__
+        struct stat sb;
+        if (stat(path, &sb) == 0) {
+            rv = sb.st_size;
+        }
+#else
         struct _stati64 sb;
         if (_stati64(path, &sb) == 0) {
             rv = sb.st_size;
         }
+#endif
     } END_NATIVE_PATH(env, path);
     return rv;
@@ -391,7 +402,13 @@
 
     WITH_NATIVE_PATH(env, file, ids.path, path) {
+#ifdef __EMX__
+        if (mkdir(path, 0777) == 0) {
+            rv = JNI_TRUE;
+        }
+#else
         if (mkdir(path) == 0) {
             rv = JNI_TRUE;
         }
+#endif
     } END_NATIVE_PATH(env, path);
     return rv;
@@ -429,5 +446,5 @@
             LARGE_INTEGER modTime;
             FILETIME t;
-            modTime.QuadPart = (time + 11644473600000L) * 10000L;
+            modTime.QuadPart = (time + 11644473600000LL) * 10000LL;
             t.dwLowDateTime = (DWORD)modTime.LowPart;
             t.dwHighDateTime = (DWORD)modTime.HighPart;
Index: /trunk/openjdk/jdk/src/windows/native/java/io/WinNTFileSystem_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/io/WinNTFileSystem_md.c	(revision 85)
+++ /trunk/openjdk/jdk/src/windows/native/java/io/WinNTFileSystem_md.c	(revision 86)
@@ -36,4 +36,13 @@
 #include <windows.h>
 #include <io.h>
+
+#ifdef __EMX__
+#include <wchar.h>
+#include <wctype.h>
+#include <ctype.h>
+#endif
+#ifdef __WIN32OS2__
+#include <minivcrt.h>
+#endif
 
 #include "jvm.h"
@@ -311,6 +320,6 @@
         modTime.LowPart = (DWORD) t.dwLowDateTime;
         modTime.HighPart = (LONG) t.dwHighDateTime;
-        rv = modTime.QuadPart / 10000;
-        rv -= 11644473600000;
+        rv = modTime.QuadPart / 10000LL;
+        rv -= 11644473600000LL;
     }
     free(pathbuf);
@@ -335,9 +344,16 @@
                must exists. Try _wstati64, we know this at least works
                for pagefile.sys and hiberfil.sys.
-            */
+           */
+#ifdef __EMX__
+            struct _stat sb;
+            if (_wstat(pathbuf, &sb) == 0) {
+                rv = sb.st_size;
+            }
+#else
             struct _stati64 sb;
             if (_wstati64(pathbuf, &sb) == 0) {
                 rv = sb.st_size;
             }
+#endif
         }
     }
@@ -580,5 +596,5 @@
         LARGE_INTEGER modTime;
         FILETIME t;
-        modTime.QuadPart = (time + 11644473600000L) * 10000L;
+        modTime.QuadPart = (time + 11644473600000LL) * 10000LL;
         t.dwLowDateTime = (DWORD)modTime.LowPart;
         t.dwHighDateTime = (DWORD)modTime.HighPart;
Index: /trunk/openjdk/jdk/src/windows/native/java/io/canonicalize_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/io/canonicalize_md.c	(revision 85)
+++ /trunk/openjdk/jdk/src/windows/native/java/io/canonicalize_md.c	(revision 86)
@@ -39,4 +39,13 @@
 #include <errno.h>
 #include "io_util_md.h"
+
+#ifdef __EMX__
+#include <wchar.h>
+#include <wctype.h>
+#include <ctype.h>
+#endif
+#ifdef __WIN32OS2__
+#include <minivcrt.h>
+#endif
 
 #undef DEBUG_PATH        /* Define this to debug path code */
Index: /trunk/openjdk/jdk/src/windows/native/java/io/io_util_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/io/io_util_md.c	(revision 85)
+++ /trunk/openjdk/jdk/src/windows/native/java/io/io_util_md.c	(revision 86)
@@ -40,4 +40,9 @@
 #include <limits.h>
 #include <wincon.h>
+
+#ifdef __WIN32OS2__
+#include <minivcrt.h>
+#include <winerror.h>
+#endif
 
 extern jboolean onNT = JNI_FALSE;
Index: /trunk/openjdk/jdk/src/windows/native/java/lang/java_props_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/lang/java_props_md.c	(revision 85)
+++ /trunk/openjdk/jdk/src/windows/native/java/lang/java_props_md.c	(revision 86)
@@ -34,4 +34,8 @@
 #include "locale_str.h"
 #include "java_props.h"
+
+#ifdef __EMX__
+#define boolean int
+#endif
 
 #ifndef VER_PLATFORM_WIN32_WINDOWS
@@ -624,4 +628,5 @@
     SYSTEM_INFO info;
     GetSystemInfo(&info);
+#ifndef __WIN32OS2__
     switch (info.wProcessorArchitecture) {
 #ifdef PROCESSOR_ARCHITECTURE_IA64
@@ -632,4 +637,7 @@
 #endif
     case PROCESSOR_ARCHITECTURE_INTEL:
+#else /* !__WIN32OS2__ */
+    {
+#endif /* !__WIN32OS2__ */
         switch (info.wProcessorLevel) {
         case 6: return haveMMX()
@@ -748,4 +756,5 @@
                 case  1: sprops.os_name = "Windows XP";           break;
                 case  2:
+#ifndef __WIN32OS2__
                     /*
                     * From MSDN OSVERSIONINFOEX and SYSTEM_INFO documentation:
@@ -766,6 +775,11 @@
                          }
                          break;
+#else /* !__WIN32OS2__ */
+                         sprops.os_name = "Windows 2003";
+                         break;
+#endif /* !__WIN32OS2__ */
                 default: sprops.os_name = "Windows NT (unknown)"; break;
                 }
+#ifndef __WIN32OS2__
             } else if (ver.dwMajorVersion == 6) {
                 /*
@@ -792,4 +806,5 @@
                     }
                 }
+#endif /* !__WIN32OS2__ */
             } else {
                 sprops.os_name = "Windows NT (unknown)";
Index: /trunk/openjdk/jdk/src/windows/native/java/util/TimeZone_md.c
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/java/util/TimeZone_md.c	(revision 85)
+++ /trunk/openjdk/jdk/src/windows/native/java/util/TimeZone_md.c	(revision 86)
@@ -28,4 +28,9 @@
 #include <stdlib.h>
 #include "TimeZone_md.h"
+
+#ifdef __EMX__
+#include <wchar.h>
+#include <string.h>
+#endif
 
 #define VALUE_UNKNOWN           0
