unix-2.7.1.0: POSIX functionality

Copyright | (c) Volker Stolz <vs@foldr.org> 2003
License | BSD-style (see the file libraries/base/LICENSE)
Maintainer | vs@foldr.org
Stability | provisional
Portability | non-portable (requires POSIX)
Safe Haskell | Safe
Language | Haskell2010

System.Posix.DynamicLinker

Description

Dynamic linker support through dlopen()

Synopsis

- module System.Posix.DynamicLinker.Prim
- dlopen :: FilePath -> [RTLDFlags] -> IO DL
- dlsym :: DL -> String -> IO (FunPtr a)
- dlerror :: IO String
- dlclose :: DL -> IO ()
- withDL :: String -> [RTLDFlags] -> (DL -> IO a) -> IO a
- withDL_ :: String -> [RTLDFlags] -> (DL -> IO a) -> IO ()
- undl :: DL -> Ptr ()

# Documentation

module System.Posix.DynamicLinker.Prim

dlopen :: FilePath -> [RTLDFlags] -> IO DL

dlsym :: DL -> String -> IO (FunPtr a)

`dlsym` returns the address binding of the symbol described in `symbol`, as it occurs in the shared object identified by `source`.

dlerror :: IO String

dlclose :: DL -> IO ()

withDL :: String -> [RTLDFlags] -> (DL -> IO a) -> IO a

withDL_ :: String -> [RTLDFlags] -> (DL -> IO a) -> IO ()

undl :: DL -> Ptr ()

`undl` obtains the raw handle. You mustn't do something like `withDL mod flags $ liftM undl >>= p -> use p`