Repository : ssh://darcs.haskell.org//srv/darcs/packages/base On branch : master
http://hackage.haskell.org/trac/ghc/changeset/ca4ee556d7efce8bf3f86c51d3bbee7b3509fb0b >--------------------------------------------------------------- commit ca4ee556d7efce8bf3f86c51d3bbee7b3509fb0b Author: Ian Lynagh <[email protected]> Date: Fri Nov 25 23:18:57 2011 +0000 Make a wrapper for getrusage; part of #5480 >--------------------------------------------------------------- System/CPUTime.hsc | 2 +- include/HsBase.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/System/CPUTime.hsc b/System/CPUTime.hsc index e98234f..06cf730 100644 --- a/System/CPUTime.hsc +++ b/System/CPUTime.hsc @@ -111,7 +111,7 @@ getCPUTime = do * 1000000) type CRUsage = () -foreign import ccall unsafe getrusage :: CInt -> Ptr CRUsage -> IO CInt +foreign import ccall unsafe "__hsbase_getrusage" getrusage :: CInt -> Ptr CRUsage -> IO CInt #elif defined(HAVE_TIMES) allocaBytes (#const sizeof(struct tms)) $ \ p_tms -> do _ <- times p_tms diff --git a/include/HsBase.h b/include/HsBase.h index 9abe4bf..d45ee99 100644 --- a/include/HsBase.h +++ b/include/HsBase.h @@ -667,5 +667,13 @@ INLINE int fcntl_lock(int fd, int cmd, struct flock *lock) { #endif +#if !defined(mingw32_HOST_OS) && !defined(cygwin32_HOST_OS) +#if defined(HAVE_GETRUSAGE) && ! irix_HOST_OS && ! solaris2_HOST_OS +INLINE int __hsbase_getrusage(int who, struct rusage *rusage) { + return getrusage(who, rusage); +} +#endif +#endif + #endif /* __HSBASE_H__ */ _______________________________________________ Cvs-libraries mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-libraries
