FIX BUILD (Solaris): include fcntl.h for file operations
[ghc-hetmet.git] / rts / posix / OSMem.c
index 9e6e62b..66f6309 100644 (file)
@@ -25,6 +25,9 @@
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
 
 #include <errno.h>
 
@@ -93,7 +96,7 @@ my_mmap (void *addr, lnat size)
     // Let's just use the underlying Mach Microkernel calls directly,
     // they're much nicer.
     
-    kern_return_t err;
+    kern_return_t err = 0;
     ret = addr;
     if(addr)   // try to allocate at adress
        err = vm_allocate(mach_task_self(),(vm_address_t*) &ret, size, FALSE);