From: Jens Axboe Date: Tue, 4 Aug 2009 10:49:59 +0000 (+0200) Subject: solaris: implement blockdev size getting X-Git-Tag: fio-1.33~11 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=515d18304324c2e11f40742c394c90799913fa67;p=fio.git solaris: implement blockdev size getting Just use lseek(..., SEEK_END), we should actually be able to use that on all platforms. Signed-off-by: Jens Axboe --- diff --git a/os/os-solaris.h b/os/os-solaris.h index f00aae10..c49ce8d9 100644 --- a/os/os-solaris.h +++ b/os/os-solaris.h @@ -28,7 +28,13 @@ typedef struct solaris_rand_seed os_random_state_t; */ static inline int blockdev_size(int fd, unsigned long long *bytes) { - return EINVAL; + off_t end = lseek(fd, 0, SEEK_END); + + if (end < 0) + return errno; + + *bytes = end; + return 0; } static inline int blockdev_invalidate_cache(int fd)