diff -Naur oprofile-0.9.3.orig/libdb/db_manage.c oprofile-0.9.3/libdb/db_manage.c
--- oprofile-0.9.3.orig/libdb/db_manage.c	2008-06-27 13:11:47.000000000 -0400
+++ oprofile-0.9.3/libdb/db_manage.c	2008-06-27 13:11:49.000000000 -0400
@@ -73,8 +73,16 @@
 	if (ftruncate(data->fd, new_file_size))
 		return 1;
 
+#ifdef __CYGWIN__
+	if (munmap(data->base_memory, old_file_size)) {
+		return 1;
+	}
+	new_map = mmap(data->base_memory, new_file_size,
+		(PROT_READ | PROT_WRITE), MAP_SHARED, data->fd, 0);
+#else
 	new_map = mremap(data->base_memory,
 			 old_file_size, new_file_size, MREMAP_MAYMOVE);
+#endif
 
 	if (new_map == MAP_FAILED)
 		return 1;
diff -Naur oprofile-0.9.3.orig/libop/op_sample_file.h oprofile-0.9.3/libop/op_sample_file.h
--- oprofile-0.9.3.orig/libop/op_sample_file.h	2008-06-27 13:11:47.000000000 -0400
+++ oprofile-0.9.3/libop/op_sample_file.h	2008-06-27 13:11:49.000000000 -0400
@@ -17,6 +17,10 @@
 #include <stdint.h>
 #include <time.h>
 
+#ifdef __CYGWIN__
+#pragma pack(push, 2)
+#endif
+
 /* header of the sample files */
 struct opd_header {
 	u8 magic[4];
@@ -39,4 +43,8 @@
 	u32 reserved1[1];
 };
 
+#ifdef __CYGWIN__
+#pragma pack(pop)
+#endif
+
 #endif /* OP_SAMPLE_FILE_H */
diff -Naur oprofile-0.9.3.orig/libpp/diff_container.cpp oprofile-0.9.3/libpp/diff_container.cpp
--- oprofile-0.9.3.orig/libpp/diff_container.cpp	2008-06-27 13:11:47.000000000 -0400
+++ oprofile-0.9.3/libpp/diff_container.cpp	2008-06-27 13:11:49.000000000 -0400
@@ -18,6 +18,10 @@
 
 #include <cmath>
 
+#ifdef __CYGWIN__
+#define INFINITY infinity()
+#endif
+
 using namespace std;
 
 
diff -Naur oprofile-0.9.3.orig/libpp/format_output.cpp oprofile-0.9.3/libpp/format_output.cpp
--- oprofile-0.9.3.orig/libpp/format_output.cpp	2008-06-27 13:11:47.000000000 -0400
+++ oprofile-0.9.3/libpp/format_output.cpp	2008-06-27 13:11:49.000000000 -0400
@@ -20,6 +20,10 @@
 #include <iostream>
 #include <cmath>
 
+#ifdef __CYGWIN__
+#define INFINITY infinity()
+#endif
+
 #include "string_manip.h"
 #include "string_filter.h"
 
