blockdev-util: add new helper blockdev_get_device_size()
This function is just a wrapper around the BLKGETSIZE64. Which is a pretty simple ioctl. The only reason to wrap it, is that the headers we need to call it are a bit messy (as "linux/fs.h" is incompatible with certain glibc headers). Hence add the simple helper that wraps it and allows us to do the header mess needed in one file only. It's also nicely symmetric to blockdev_get_sector_size().
This commit is contained in:
@@ -57,5 +57,6 @@ int block_device_has_partitions(sd_device *dev);
|
||||
int blockdev_reread_partition_table(sd_device *dev);
|
||||
|
||||
int blockdev_get_sector_size(int fd, uint32_t *ret);
|
||||
int blockdev_get_device_size(int fd, uint64_t *ret);
|
||||
|
||||
int blockdev_get_root(int level, dev_t *ret);
|
||||
|
||||
Reference in New Issue
Block a user