github.com/lmars/docker@v1.6.0-rc2/pkg/system/mknod.go (about)

     1  // +build !windows
     2  
     3  package system
     4  
     5  import (
     6  	"syscall"
     7  )
     8  
     9  func Mknod(path string, mode uint32, dev int) error {
    10  	return syscall.Mknod(path, mode, dev)
    11  }
    12  
    13  // Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes.
    14  // They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major,
    15  // then the top 12 bits of the minor
    16  func Mkdev(major int64, minor int64) uint32 {
    17  	return uint32(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff))
    18  }