diff -rup2 ../ruby-1.8.1-base/configure.in ./configure.in
--- ../ruby-1.8.1-base/configure.in	Thu Dec 25 04:19:12 2003
+++ ./configure.in	Thu Dec 25 09:27:54 2003
@@ -391,5 +391,5 @@ AC_REPLACE_FUNCS(dup2 memmove mkdir strc
 		 isnan finite isinf hypot acosh erf)
 AC_CHECK_FUNCS(fmod killpg wait4 waitpid syscall chroot fsync getcwd\
-	      truncate chsize times utimes fcntl lockf lstat symlink readlink\
+	      truncate chsize times utimes fcntl lockf lstat link symlink readlink\
 	      setitimer setruid seteuid setreuid setresuid setproctitle\
 	      setrgid setegid setregid setresgid issetugid pause lchown lchmod\
diff -rup2 ../ruby-1.8.1-base/file.c ./file.c
--- ../ruby-1.8.1-base/file.c	Thu Dec 25 00:19:08 2003
+++ ./file.c	Thu Dec 25 09:32:46 2003
@@ -1881,4 +1881,5 @@ rb_file_s_link(klass, from, to)
     VALUE klass, from, to;
 {
+#ifdef HAVE_LINK
     SafeStringValue(from);
     SafeStringValue(to);
@@ -1888,4 +1889,8 @@ rb_file_s_link(klass, from, to)
     }
     return INT2FIX(0);
+#else
+    rb_notimplement();
+    return Qnil;		/* not reached */
+#endif
 }
 
diff -rup2 ../ruby-1.8.1-base/bcc32/Makefile.sub ./bcc32/Makefile.sub
--- ../ruby-1.8.1-base/bcc32/Makefile.sub	Tue Dec 23 18:11:10 2003
+++ ./bcc32/Makefile.sub	Thu Dec 25 09:29:02 2003
@@ -247,4 +247,5 @@ config.h:
 /* \#define HAVE_UTIMES 1    */
 /* \#define HAVE_FCNTL 1     */
+\#define HAVE_LINK 1
 /* \#define HAVE_SETITIMER 1 */
 /* \#define HAVE_GETGROUPS 1 */
diff -rup2 ../ruby-1.8.1-base/missing/os2.c ./missing/os2.c
--- ../ruby-1.8.1-base/missing/os2.c	Tue Mar  6 02:08:26 2001
+++ ./missing/os2.c	Thu Dec 25 09:29:40 2003
@@ -18,4 +18,5 @@ chown(char *path, int owner, int group)
 }
 
+#if 0
 int
 link(char *from, char *to)
@@ -23,4 +24,28 @@ link(char *from, char *to)
 	return -1;
 }
+#endif
+
+#if defined(EMX_REPLACE_GETCWD) && (EMX_REPLACE_GETCWD)  \
+ || defined(EMX_REPLACE_CHDIR)  && (EMX_REPLACE_CHDIR)
+#include <unistd.h>
+
+#if defined(EMX_REPLACE_GETCWD) && (EMX_REPLACE_GETCWD)
+/* to handle the drive letter and DBCS characters within a given path */
+char *
+getcwd(char *path, size_t len)
+{
+    return _getcwd2(path, (int)len);
+}
+#endif
+
+#if defined(EMX_REPLACE_CHDIR) && (EMX_REPLACE_CHDIR)
+/* to handle the drive letter and DBCS characters within a given path */
+int
+chdir(__const__ char *path)
+{
+    return _chdir2(path);
+}
+#endif
+#endif
 
 typedef char* CHARP;
diff -rup2 ../ruby-1.8.1-base/win32/Makefile.sub ./win32/Makefile.sub
--- ../ruby-1.8.1-base/win32/Makefile.sub	Mon Dec 22 18:29:12 2003
+++ ./win32/Makefile.sub	Thu Dec 25 09:30:22 2003
@@ -268,4 +268,5 @@ config.h:
 #define HAVE_CHSIZE 1
 #define HAVE_TIMES 1
+#define HAVE_LINK 1
 #define HAVE__SETJMP 1
 #define HAVE_TELLDIR 1
