(device string)
| 229 | } |
| 230 | |
| 231 | func 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 | |
| 244 | func rereadPartitions(device string) error { |
| 245 | file, err := os.Open(device) |