Documentation ¶
Overview ¶
Package shm allows for opening and operating on shared memory devices
Index ¶
Constants ¶
const ( PROT_RDWR = syscall.PROT_READ | syscall.PROT_WRITE PROT_READ = syscall.PROT_READ )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer interface { Bytes() []byte Len() int Close() error CloseFile() error String() string File() *os.File LocalFile() *os.File Advise(offset, length, advice int) error Lock(offset, length int) error LockAll() error Unlock(offset, length int) error UnlockAll() error }
The Buffer interface represents a shared memory buffer
func NewBufferFile ¶
NewBufferFile maps a file to shared memory and returns a handle to the shared memory buffer
func NewBufferHugepages ¶
NewBufferTmpfs maps /dev/hugepages into shared memory and returns a handle to the shared memory buffer
func NewBufferMemoryFs ¶
NewBufferMemoryFs maps a mounted file system into shared memory and returns a handle to the shared memory buffer
func NewBufferSlice ¶
NewBufferSlice returns a mock shared memory object that is backed by a byte slice, instead of mapped memory Pay carefull attentions to which methods are implemented
func NewBufferTmpfs ¶
NewBufferTmpfs maps /dev/shm into shared memory and returns a handle to the shared memory buffer