[project @ 1998-04-30 19:55:57 by sof]
authorsof <unknown>
Thu, 30 Apr 1998 19:55:57 +0000 (19:55 +0000)
committersof <unknown>
Thu, 30 Apr 1998 19:55:57 +0000 (19:55 +0000)
Opt for times() over getrusage() on Solaris boxes

ghc/lib/std/cbits/getCPUTime.lc

index d3d7b2a..15488e9 100644 (file)
@@ -71,7 +71,14 @@ getCPUTime(StgByteArray cpuStruct)
 {
     StgInt *cpu=(StgInt *)cpuStruct;
 
-#if defined(HAVE_GETRUSAGE) && ! irix_TARGET_OS
+/* getrusage() is right royal pain to deal with when targetting multiple
+   versions of Solaris, since some versions supply it in libc (2.3 and 2.5),
+   while 2.4 has got it in libucb (I wouldn't be too surprised if it was back
+   again in libucb in 2.6..)
+
+   Avoid the problem by resorting to times() instead.
+*/
+#if defined(HAVE_GETRUSAGE) && ! irix_TARGET_OS && ! solaris2_TARGET_OS
     struct rusage t;
 
     getrusage(RUSAGE_SELF, &t);