package devices

import "github.com/opencontainers/runc/libcontainer/devices"

Package devices provides some helper functions for constructing device configurations for runc. These are exclusively used by higher-level runtimes that need to configure runc's device list based on existing devices.

Deprecated: Use github.com/moby/sys/devices instead. This package will be removed in runc 1.6.

Index

Variables

var ErrNotADevice = devices.ErrNotADevice

ErrNotADevice denotes that a file is not a valid linux device.

Deprecated: Use devices.ErrNotADevice instead. This package will be removed in runc 1.6.

Functions

func DeviceFromPath

func DeviceFromPath(path, permissions string) (*config.Device, error)

DeviceFromPath takes the path to a device and its cgroup_permissions (which cannot be easily queried) to look up the information about a linux device and returns that information as a Device struct.

Deprecated: Use devices.DeviceFromPath instead. This package will be removed in runc 1.6.

func GetDevices

func GetDevices(path string) ([]*config.Device, error)

GetDevices recursively traverses a directory specified by path and returns all devices found there.

Deprecated: Use devices.GetDevices instead. This package will be removed in runc 1.6.

func HostDevices

func HostDevices() ([]*config.Device, error)

HostDevices returns all devices that can be found under /dev directory.

Deprecated: Use devices.HostDevices instead. This package will be removed in runc 1.6.

Source Files

device_deprecated_unix.go

Version
v1.5.0-rc.2
Published
Apr 3, 2026
Platform
linux/amd64
Imports
2 packages
Last checked
52 minutes ago

Tools for package owners.