/usr/share/doc/libghc-mmap-doc/html/mmap.txt is in libghc-mmap-doc 0.5.9-5build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | -- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Memory mapped files for POSIX and Windows
--
-- This library provides a wrapper to mmap(2) or MapViewOfFile, allowing
-- files or devices to be lazily loaded into memory as strict or lazy
-- ByteStrings, ForeignPtrs or plain Ptrs, using the virtual memory
-- subsystem to do on-demand loading. Modifications are also supported.
@package mmap
@version 0.5.9
-- | This library provides a wrapper to mmap(2) or MapViewOfFile, allowing
-- files or devices to be lazily loaded into memory as strict or lazy
-- ByteStrings, ForeignPtrs or plain Ptrs, using the virtual memory
-- subsystem to do on-demand loading. Modifications are also supported.
module System.IO.MMap
-- | Mode of mapping. Four cases are supported.
data Mode
-- | file is mapped read-only, file must exist
ReadOnly :: Mode
-- | file is mapped read-write, file must exist
ReadWrite :: Mode
-- | file is mapped read-write, but changes aren't propagated to disk, file
-- must exist
WriteCopy :: Mode
-- | file is mapped read-write, if file does not exist it will be created
-- with default permissions, region parameter specifies size, if file
-- size is lower it will be extended with zeros
ReadWriteEx :: Mode
-- | The <a>mmapFilePtr</a> function maps a file or device into memory,
-- returning a tuple <tt>(ptr,rawsize,offset,size)</tt> where:
--
-- <ul>
-- <li><tt>ptr</tt> is pointer to mmapped region</li>
-- <li><tt>rawsize</tt> is length (in bytes) of mapped data, rawsize
-- might be greater than size because of alignment</li>
-- <li><tt>offset</tt> tell where your data lives: <tt>plusPtr ptr
-- offset</tt></li>
-- <li><tt>size</tt> your data length (in bytes)</li>
-- </ul>
--
-- If <a>mmapFilePtr</a> fails for some reason, a <a>throwErrno</a> is
-- used.
--
-- Use <tt>munmapFilePtr ptr rawsize</tt> to unmap memory.
--
-- Memory mapped files will behave as if they were read lazily pages from
-- the file will be loaded into memory on demand.
mmapFilePtr :: FilePath -> Mode -> Maybe (Int64, Int) -> IO (Ptr a, Int, Int, Int)
-- | Memory map region of file using autounmap semantics. See
-- <a>mmapFilePtr</a> for description of parameters. The <tt>action</tt>
-- will be executed with tuple <tt>(ptr,size)</tt> as single argument.
-- This is the pointer to mapped data already adjusted and size of
-- requested region. Return value is that of action.
mmapWithFilePtr :: FilePath -> Mode -> Maybe (Int64, Int) -> ((Ptr (), Int) -> IO a) -> IO a
-- | Maps region of file and returns it as <a>ForeignPtr</a>. See
-- <a>mmapFilePtr</a> for details.
mmapFileForeignPtr :: FilePath -> Mode -> Maybe (Int64, Int) -> IO (ForeignPtr a, Int, Int)
-- | Maps region of file and returns it as <a>ByteString</a>. File is
-- mapped in in <a>ReadOnly</a> mode. See <a>mmapFilePtr</a> for details.
mmapFileByteString :: FilePath -> Maybe (Int64, Int) -> IO ByteString
-- | Unmaps memory region. As parameters use values marked as ptr and
-- rawsize in description of <a>mmapFilePtr</a>.
munmapFilePtr :: Ptr a -> Int -> IO ()
-- | The <a>mmapFileForeignPtrLazy</a> function maps a file or device into
-- memory, returning a list of tuples with the same meaning as in
-- function <a>mmapFileForeignPtr</a>.
--
-- Chunks are really mapped into memory at the first inspection of a
-- chunk. They are kept in memory while they are referenced, garbage
-- collector takes care of the later.
mmapFileForeignPtrLazy :: FilePath -> Mode -> Maybe (Int64, Int64) -> IO [(ForeignPtr a, Int, Int)]
-- | Maps region of file and returns it as <a>ByteString</a>. File is
-- mapped in in <a>ReadOnly</a> mode. See <a>mmapFileForeignPtrLazy</a>
-- for details.
mmapFileByteStringLazy :: FilePath -> Maybe (Int64, Int64) -> IO ByteString
instance GHC.Read.Read System.IO.MMap.Mode
instance GHC.Show.Show System.IO.MMap.Mode
instance GHC.Enum.Enum System.IO.MMap.Mode
instance GHC.Classes.Ord System.IO.MMap.Mode
instance GHC.Classes.Eq System.IO.MMap.Mode
|