//go:build linux package host import ( "golang.org/x/sys/unix" "os" ) func openRegistryDescriptor(parent int, name string) (int, error) { return unix.Openat(parent, name, unix.O_PATH|unix.O_NOFOLLOW|unix.O_CLOEXEC, 0) } func chownRegistryDescriptor(f *os.File, uid, gid int) error { return unix.Fchownat(int(f.Fd()), "", uid, gid, unix.AT_EMPTY_PATH|unix.AT_SYMLINK_NOFOLLOW) }