X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;ds=sidebyside;f=os%2Fos-solaris.h;h=5029d38f356e5983992bb58ae04cfffa77773a5d;hb=a1c58075279454a91ec43366846b93e8dcf9753c;hp=f00aae1089b19380fd05d2f8017facea2847cea5;hpb=f2b7ce1c8f2d5ada9b0f789b48b94dc234195fa8;p=fio.git diff --git a/os/os-solaris.h b/os/os-solaris.h index f00aae10..5029d38f 100644 --- a/os/os-solaris.h +++ b/os/os-solaris.h @@ -23,12 +23,15 @@ struct solaris_rand_seed { typedef psetid_t os_cpu_mask_t; typedef struct solaris_rand_seed os_random_state_t; -/* - * FIXME - */ 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) @@ -105,4 +108,8 @@ static inline int fio_cpuset_exit(os_cpu_mask_t *mask) */ #define FIO_MAX_CPUS 16384 +#ifdef MADV_FREE +#define FIO_MADV_FREE MADV_FREE +#endif + #endif