mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
20 lines
335 B
Go
20 lines
335 B
Go
//go:build darwin
|
|
// +build darwin
|
|
|
|
package fs
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
|
|
"github.com/pkg/errors"
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func copyDevice(dst string, fi os.FileInfo) error {
|
|
st, ok := fi.Sys().(*syscall.Stat_t)
|
|
if !ok {
|
|
return errors.New("unsupported stat type")
|
|
}
|
|
return unix.Mknod(dst, uint32(fi.Mode()), int(st.Rdev))
|
|
}
|