cpuset

package
v0.31.2 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package cpuset parses and formats cpuset strings like "0-3,5,7-9".

Index

Constants

View Source
const MaxCPU = 8192

MaxCPU is the largest CPU/memory-node index Parse accepts. It bounds the set Parse allocates so an untrusted value like "0-999999999" cannot exhaust memory.

Variables

This section is empty.

Functions

func Format

func Format(set map[int]struct{}) string

Format emits a sorted, range-collapsed cpuset string from a set.

func Parse

func Parse(s string) (map[int]struct{}, error)

Parse parses a cpuset string into a set of integers. An empty input returns an empty set with no error. Elements must be in the range [0, MaxCPU].

func Validate

func Validate(s string) error

Validate returns an error if s is not a syntactically valid cpuset string. An empty string is valid (means "unset").

Types

This section is empty.

Jump to

Keyboard shortcuts

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