Simplify some CPP
Make a wrapper for getrusage; part of #5480
Convert come FFI bindings to use the capi calling convention
update to track changes to CCCS in the RTS
Add a way to get hold of the current call stack

  GHC.Stack.currentCallStack :: IO [String]

At the moment this uses the profiler's cost-centre stack; maybe in the
future it might use some other mechanism.  Right now it only gives
useful results when profiling and using -fprof-auto or similar, but it
could be quite handy. e.g.

f :: Int -> IO Int
f x = do currentCallStack >>= print; return (x+1)

mapM :: Monad m => (a -> m b) -> [a] -> m [b]
mapM f xs = go xs
  where go []     = return []
        go (x:xs) = do
          x' <- f x
          xs' <- mapM f xs
          return (x':xs')

main = mapM f [42,42]

$ ./stack
["MAIN.MAIN","Main.main","Main.mapM","Main.mapM.go","Main.f"]
["MAIN.MAIN","Main.main","Main.mapM","Main.mapM.go","Main.f"]
Use capi some more (part of #5480)
Use capi to define the fcntl FFI imports
Use utf8 when decoding cost centre strings
Expand the stack-tracing API

 - add whoCreated :: a -> IO [String]
   Get the stack trace attached to an object

 - rename getCCCS to getCurrentCCS

 - add getCCSOf (used to implement whoCreated)

 - add renderStack :: [String] -> String
   A handy function for prettifying a stack
Add traceStack :: String -> a -> a

-- | like 'trace', but additionally prints a call stack if one is
-- available.
--
-- In the current GHC implementation, the call stack is only
-- availble if the program was compiled with @-prof@; otherwise
-- 'traceStack' behaves exactly like 'trace'.  Entries in the call
-- stack correspond to @SCC@ annotations, so it is a good idea to use
-- @-fprof-auto@ to add SCC annotations automatically.
Change the layout of stack traces

Stack trace:
  Main.CAF
  Main.main
  Main.main.xs
  Main.map
  Main.map.go
  Main.f
Track changes to the way we reference CCCS in GHC (was: W_[CCCS], now: CCCS)
Add source locations to call stack entries.
Use the mingw touch program on Windows
Roll back the sigset capi changes

They broken the build on OSX. See #2979.
doc update: mention -fprof-auto-calls
renderStack: reverse the stack trace (most recent frame first)
add setNumCapabilities :: Int -> IO ()

{- |
Set the number of Haskell threads that can run truly simultaneously
(on separate physical processors) at any given time.

GHC notes: in the current implementation, the value may only be
/increased/, not decreased, by calling 'setNumCapabilities'.  The
initial value is given by the @+RTS -N@ flag, and the current value
may be obtained using 'getNumCapabilities'.
-}
Add getNumProcessors :: IO Int
Fix typo