swap

package
v2.0.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2025 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package swap provides functions to manage swap devices.

Index

Constants

View Source
const (
	FLAG_DISCARD       = 0x10000
	FLAG_DISCARD_ONCE  = 0x20000
	FLAG_DISCARD_PAGES = 0x40000
)

Flags for swapon syscall.

Variables

This section is empty.

Functions

func Format

func Format(path string, options FormatOptions) error

Format implements the mkswap function to format a swap device.

func Off

func Off(path string) error

Off implements the swapoff syscall to disable swap on a device.

func On

func On(path string, flags uintptr) error

On implements the swapon syscall to enable swap on a device.

Types

type FormatOptions

type FormatOptions struct {
	Label string
	UUID  uuid.UUID
}

FormatOptions contains options for formatting a swap device.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL