diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2009-08-04 12:49:59 +0200 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-08-04 12:49:59 +0200 |
commit | 515d18304324c2e11f40742c394c90799913fa67 (patch) | |
tree | 359bec4f069d26d731e6f687e0890fa1b83b6ef1 /os/os-solaris.h | |
parent | 983b770d547c11d8b0a4ef9e1ac75ffce1d4e46d (diff) | |
download | fio-515d18304324c2e11f40742c394c90799913fa67.tar.gz fio-515d18304324c2e11f40742c394c90799913fa67.tar.bz2 |
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 <jens.axboe@oracle.com>
Diffstat (limited to 'os/os-solaris.h')
-rw-r--r-- | os/os-solaris.h | 8 |
1 files changed, 7 insertions, 1 deletions
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) |