github.com/khulnasoft-lab/khulnasoft@v26.0.1-0.20240328202558-330a6f959fe0+incompatible/pkg/system/mknod.go (about)

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