Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Provides shared memory for IPC (Inter Process Communication).
Synopsis
- openSharedMemory :: String -> CSize -> ShmOpenFlags -> FileMode -> IO (ForeignPtr (), Fd)
Documentation
openSharedMemory :: String -> CSize -> ShmOpenFlags -> FileMode -> IO (ForeignPtr (), Fd) Source #
openSharedMemory shmemPath size openFlags openFileMode
:
Creates a shared memory file using shm_open
at shmemPath
of size
bytes,
returning the created Fd
and ForeignPtr
pointing to the mmap
'ed memory.
The Fd
can be used to resize the shared memory region.
When the returned ForeignPtr
is garbage collected, the memory is munmap
'ed,
but the Fd
remains open until it is closed or garbage collected.
Closing the Fd
will not invalidate the returned ForeignPtr
.