mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-28 11:17:59 +00:00
24 lines
484 B
Go
24 lines
484 B
Go
//go:build freebsd
|
|
|
|
package archive
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func mknod(path string, mode uint32, dev uint64) error {
|
|
return unix.Mknod(path, mode, dev)
|
|
}
|
|
|
|
func mknodInRoot(root *os.Root, path string, mode uint32, dev uint64) error {
|
|
parent, err := root.OpenFile(filepath.Dir(path), os.O_RDONLY|unix.O_DIRECTORY, 0)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer parent.Close()
|
|
|
|
return unix.Mknodat(int(parent.Fd()), filepath.Base(path), mode, dev)
|
|
}
|