mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
3d2fae353f
Some parts of pkg/archive is called on both client/daemon code. To get it compiling on Windows, these funcs are extracted into files with build tags. Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
18 lines
501 B
Go
18 lines
501 B
Go
// +build !windows
|
|
|
|
package system
|
|
|
|
import (
|
|
"syscall"
|
|
)
|
|
|
|
func Mknod(path string, mode uint32, dev int) error {
|
|
return syscall.Mknod(path, mode, dev)
|
|
}
|
|
|
|
// Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes.
|
|
// They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major,
|
|
// then the top 12 bits of the minor
|
|
func Mkdev(major int64, minor int64) uint32 {
|
|
return uint32(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff))
|
|
}
|