diff --git a/libgloss/i386/cygmon-gmon.c b/libgloss/i386/cygmon-gmon.c
index 88bdf251c..778dbd76d 100644
--- a/libgloss/i386/cygmon-gmon.c
+++ b/libgloss/i386/cygmon-gmon.c
@@ -62,6 +62,7 @@ static char sccsid[] = "@(#)gmon.c	5.3 (Berkeley) 5/22/91";
 #include <stdio.h>
 #endif
 
+#include <fcntl.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
@@ -193,6 +194,25 @@ monstartup(lowpc, highpc)
   moncontrol (1);
 }
 
+static void
+profil_write (int type, void *buffer, int len)
+{
+  static int des = -1;
+
+  if (des < 0)
+    {
+      des = open ("gmon.out", O_WRONLY | O_CREAT | O_TRUNC, 0644);
+    }
+  if (len == 0)
+    {
+      close (des);
+    }
+  else
+    {
+      write (des, buffer, len);
+    }
+}
+
 void
 _mcleanup()
 {
diff --git a/libgloss/i386/cygmon-salib.c b/libgloss/i386/cygmon-salib.c
index b4a4d34b3..734afe9d6 100644
--- a/libgloss/i386/cygmon-salib.c
+++ b/libgloss/i386/cygmon-salib.c
@@ -161,22 +161,3 @@ __do_global_dtors ()
     }
 }
 #endif
-
-void
-profil_write (int type, char *buffer, int len)
-{
-  static int des = -1;
-
-  if (des < 0)
-    {
-      des = open ("gmon.out", O_WRONLY | O_CREAT | O_TRUNC, 0644);
-    }
-  if (len == 0)
-    {
-      close (des);
-    }
-  else
-    {
-      write (des, buffer, len);
-    }
-}
