[MLton-commit] r5878

Ville Laurikari ville at mlton.org
Wed Aug 15 01:49:45 PDT 2007


Changes required for HP-UX 11.11 and 11.23, and catching up with other
runtime changes.

----------------------------------------------------------------------

U   mlton/trunk/runtime/platform/hpux.c
U   mlton/trunk/runtime/platform/hpux.h

----------------------------------------------------------------------

Modified: mlton/trunk/runtime/platform/hpux.c
===================================================================
--- mlton/trunk/runtime/platform/hpux.c	2007-08-14 22:30:42 UTC (rev 5877)
+++ mlton/trunk/runtime/platform/hpux.c	2007-08-15 08:49:44 UTC (rev 5878)
@@ -9,9 +9,10 @@
 
 #include "diskBack.unix.c"
 #include "mkdir2.c"
+#include "mmap-protect.c"
+#include "nonwin.c"
 #include "recv.nonblock.c"
 #include "setenv.putenv.c"
-#include "mmap-protect.c"
 #include "use-mmap.c"
 
 extern unsigned char __text_start;
@@ -104,10 +105,18 @@
         sa->sa_sigaction = (void (*)(int, siginfo_t*, void*))catcher;
 }
 
-size_t GC_totalRam (void) {
+size_t GC_pageSize (void) {
         struct pst_static buf;
 
         if (pstat_getstatic (&buf, sizeof (buf), 1, 0) < 0)
+                diee ("failed to get page size");
+        return buf.page_size;
+}
+
+uintmax_t GC_physMem (void) {
+        struct pst_static buf;
+
+        if (pstat_getstatic (&buf, sizeof (buf), 1, 0) < 0)
                 diee ("failed to get physical memory size");
         return buf.physical_memory * buf.page_size;
 }

Modified: mlton/trunk/runtime/platform/hpux.h
===================================================================
--- mlton/trunk/runtime/platform/hpux.h	2007-08-14 22:30:42 UTC (rev 5877)
+++ mlton/trunk/runtime/platform/hpux.h	2007-08-15 08:49:44 UTC (rev 5878)
@@ -17,6 +17,7 @@
 #include <poll.h>
 #include <signal.h>
 #include <sys/poll.h>
+#include <sys/privgrp.h>
 #include <sys/ptrace.h>
 #include <sys/resource.h>
 #include <sys/socket.h>
@@ -31,6 +32,16 @@
 
 #include "setenv.h"
 
+#if defined(SO_TOE)
+#define HPUX_VERSION 1123
+#elif defined(PRIV_PSET)
+#define HPUX_VERSION 1111
+#elif defined(PRIV_SPUCTL)
+#define HPUX_VERSION 1100
+#else
+#error "HP-UX 11.00 is the oldest supported version."
+#endif
+
 #define HAS_FEROUND TRUE
 #define HAS_FPCLASSIFY TRUE
 #define HAS_MSG_DONTWAIT FALSE
@@ -54,27 +65,32 @@
 #define AF_INET6 22 /* Internet Protocol, Version 6 */
 #define PF_INET6 AF_INET6
 
-struct sockaddr_in6 { 
+struct sockaddr_in6 {
   int dummy; // quell gcc warnings about "struct has no members"
 };
+#endif /* !AF_INET6 */
+
+#if HPUX_VERSION <= 1111
 struct sockaddr_storage {
   union {
     struct sockaddr_in sa_in;
     struct sockaddr_un sa_un;
   } sa;
-}
+};
+#endif /* HPUX_VERSION <= 1111 */
 
-#endif
-
 typedef long suseconds_t; // type of timeval.tv_usec in sys/time.h
 
+#if HPUX_VERSION <= 1100
 /* These GCC builtins aren't defined in the system headers. */
 float modff(float x, float *iptr);
 float rintf(float x);
 float frexpf(float x, int *exp);
 float ldexpf(float x, int exp);
+#endif /* HPUX_VERSION <= 1100 */
 
 #define PRIxPTR "lx"
+#define PRIuPTR "lu"
 
 /* These are incorrectly defined in the system headers. */
 #undef PRIu32




More information about the MLton-commit mailing list