gvisorgvisor.dev/gvisor/pkg/memutil Index | Files

package memutil

import "gvisor.dev/gvisor/pkg/memutil"

Package memutil provides utilities for working with shared memory files.

Index

Functions

func CreateMemFD

func CreateMemFD(name string, flags int) (int, error)

CreateMemFD creates a memfd file and returns the fd.

func MapFile

func MapFile(addr, size, prot, flags, fd, offset uintptr) (uintptr, error)

MapFile returns a memory mapping configured by the given options as per mmap(2).

func MapSlice

func MapSlice(addr, size, prot, flags, fd, offset uintptr) ([]byte, error)

MapSlice is like MapFile, but returns a slice instead of a uintptr.

func UnmapSlice

func UnmapSlice(slice []byte) error

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.