[Haskell-cafe] FFI question

Vasili I. Galchin vigalchin at gmail.com
Mon Sep 8 07:11:10 UTC 2014


Hello,

     I need memory refreshing about FFI because I need to fix a bug
(plus I got down a rat hole because of Ukraine war :-(). Following a
snippet of something I wrote:

-- | lock all of the memory space of a process
lockAllMemory :: LockAllFlags -> IO ()
lockAllMemory flags = do
    throwErrnoIfMinus1 "lockAllMemory" (c_mlockall cflags)
    return ()
  where
    cflags = case flags of
                   CURRENT          -> (#const MCL_CURRENT)
                   FUTURE           -> (#const MCL_FUTURE)
                   CURRENTandFUTURE -> (#const MCL_CURRENTandFUTURE)


it is a file called LockedMem.hsc and the third arm CURRENTandFUTURE I
just added to fix the this  bug ..

MCL_CURRENTandFUTURE ends up in LockedMem_make.c(sp??) but I get a
undeclared nasty message when I try to build LockedMem.hsc... my
bad... . Please help so I can go back to help Ukraine.

Kind regarsd,

Vasya


More information about the Haskell-Cafe mailing list