You must login to view /gokrazy/tools/src/commit/b8fc58bd9f3fc939026255c3fdb0cf446aa5b562/internal/packer/parttable_linux.go.
The GitHub option should be usable for most people, it only links via username.

Files
tools/internal/packer/parttable_linux.go

16 lines
294 B
Go

package packer
import (
"unsafe"
"golang.org/x/sys/unix"
)
func deviceSize(fd uintptr) (uint64, error) {
var devsize uint64
if _, _, errno := unix.Syscall(unix.SYS_IOCTL, fd, unix.BLKGETSIZE64, uintptr(unsafe.Pointer(&devsize))); errno != 0 {
return 0, errno
}
return devsize, nil
}