package platform

import "github.com/dotcloud/docker/internal/platform"

Index

Functions

func Architecture

func Architecture() string

Architecture returns the runtime architecture of the process.

Unlike runtime.GOARCH (which refers to the compiler platform), Architecture refers to the running platform.

For example, Architecture reports "x86_64" as architecture, even when running a "linux/386" compiled binary on "linux/amd64" hardware.

func NumProcs

func NumProcs() uint32

NumProcs returns the number of processors on the system

Deprecated: temporary stub for non-Windows to provide an alias for the deprecated github.com/docker/docker/pkg/platform package.

FIXME(thaJeztah): remove once we remove github.com/docker/docker/pkg/platform

func PossibleCPU

func PossibleCPU() []int

PossibleCPU returns the set of possible CPUs on the host (which is equal or larger to the number of CPUs currently online). The returned set may be a single CPU number ({0}), or a continuous range of CPU numbers ({0,1,2,3}), or a non-continuous range of CPU numbers ({0,1,2,3,12,13,14,15}).

Source Files

platform.go platform_linux.go platform_unix.go

Version
v28.1.1+incompatible (latest)
Published
Apr 18, 2025
Platform
linux/amd64
Imports
8 packages
Last checked
6 hours ago

Tools for package owners.