github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/engine/pkg/system/mknod.go (about) 1 //go:build !windows 2 // +build !windows 3 4 package system // import "github.com/docker/docker/pkg/system" 5 6 import ( 7 "golang.org/x/sys/unix" 8 ) 9 10 // Mkdev is used to build the value of linux devices (in /dev/) which specifies major 11 // and minor number of the newly created device special file. 12 // Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes. 13 // They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major, 14 // then the top 12 bits of the minor. 15 func Mkdev(major int64, minor int64) uint32 { 16 return uint32(unix.Mkdev(uint32(major), uint32(minor))) 17 }