package memutil
import "gvisor.dev/gvisor/pkg/memutil"
Package memutil provides utilities for working with shared memory files.
Index ¶
- func CreateMemFD(name string, flags int) (int, error)
- func MapFile(addr, size, prot, flags, fd, offset uintptr) (uintptr, error)
- func MapSlice(addr, size, prot, flags, fd, offset uintptr) ([]byte, error)
- func UnmapSlice(slice []byte) error
Functions ¶
func CreateMemFD ¶
CreateMemFD creates a memfd file and returns the fd.
func MapFile ¶
MapFile returns a memory mapping configured by the given options as per mmap(2).
func MapSlice ¶
MapSlice is like MapFile, but returns a slice instead of a uintptr.
func UnmapSlice ¶
UnmapSlice unmaps a mapping returned by MapSlice.
Source Files ¶
memfd_linux_unsafe.go memutil_unsafe.go mmap.go
- Version
- v0.0.0-20250605235530-a6711d1e1dc6 (latest)
- Published
- Jun 5, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 4 hours ago –
Tools for package owners.