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-20250726022846-8a89a2fab4a2 (latest)
Published
Jul 26, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
1 day ago

Tools for package owners.