MCPcopy Index your code
hub / github.com/linuxkit/linuxkit / deviceSize

Function deviceSize

pkg/extend/extend.go:231–242  ·  view source on GitHub ↗
(device string)

Source from the content-addressed store, hash-verified

229}
230
231func deviceSize(device string) (int64, error) {
232 file, err := os.Open(device)
233 if err != nil {
234 return 0, err
235 }
236 defer file.Close()
237 var devsize int64
238 if _, _, errno := unix.Syscall(unix.SYS_IOCTL, file.Fd(), unix.BLKGETSIZE, uintptr(unsafe.Pointer(&devsize))); errno != 0 {
239 return 0, errno
240 }
241 return devsize, nil
242}
243
244func rereadPartitions(device string) error {
245 file, err := os.Open(device)

Callers 1

extendFunction · 0.85

Calls 2

OpenMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected