X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=os%2Fos-solaris.h;h=5029d38f356e5983992bb58ae04cfffa77773a5d;hp=56729565b127631b2061258c7a9e373e47da7f21;hb=a1c58075279454a91ec43366846b93e8dcf9753c;hpb=e8462bd8250cf3ff2d41f17e1a4d4cefc70b6b37 diff --git a/os/os-solaris.h b/os/os-solaris.h index 56729565..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) @@ -70,7 +73,7 @@ static inline int fio_set_odirect(int fd) * pset binding hooks for fio */ #define fio_setaffinity(pid, cpumask) \ - pset_bind(&(cpumask), P_PID, (pid), NULL) + pset_bind((cpumask), P_PID, (pid), NULL) #define fio_getaffinity(pid, ptr) ({ 0; }) #define fio_cpu_clear(mask, cpu) pset_assign(PS_NONE, (cpu), NULL) @@ -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