[project @ 1996-06-30 15:56:44 by partain]
[ghc-hetmet.git] / ghc / runtime / io / getCPUTime.lc
index 9c82307..729a101 100644 (file)
@@ -4,7 +4,9 @@
 \subsection[getCPUTime.lc]{getCPUTime Runtime Support}
 
 \begin{code}
+#define NON_POSIX_SOURCE /*needed for solaris2 only?*/
 
+/* how is this to work given we have not read platform.h yet? */
 #ifdef hpux_TARGET_OS
 #define _INCLUDE_HPUX_SOURCE
 #endif
  * seconds to overflow 31 bits.
  */
 
-StgAddr
-getCPUTime(STG_NO_ARGS)
+StgByteArray
+getCPUTime(cpuStruct)
+StgByteArray cpuStruct;
 {
-    static StgInt cpu[4];
+    StgInt *cpu=(StgInt *)cpuStruct;
 
 #if defined(HAVE_GETRUSAGE) && ! irix_TARGET_OS
     struct rusage t;
@@ -84,7 +87,7 @@ getCPUTime(STG_NO_ARGS)
     return NULL;
 # endif
 #endif
-    return (StgAddr) cpu;
+    return (StgByteArray) cpuStruct;
 }
 
 \end{code}