mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Some checks failed
This change extracts the required information from the host device node if available. Signed-off-by: Evan Lezar <elezar@nvidia.com>
15 lines
277 B
Go
15 lines
277 B
Go
package config
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func mkDev(d *Rule) (uint64, error) {
|
|
if d.Major == Wildcard || d.Minor == Wildcard {
|
|
return 0, errors.New("cannot mkdev() device with wildcards")
|
|
}
|
|
return unix.Mkdev(uint32(d.Major), uint32(d.Minor)), nil
|
|
}
|