X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=os%2Fos-freebsd.h;h=0cb7ae5e5ca079380e20a514f1f0f1b9df3748c2;hp=8d965aadf87ec84372f83bd07029f2e414c35992;hb=ecc314ba7c5f02b7e90ac1dfbce1a74cd4e6d6fe;hpb=e72fa4d40565e7a213698d8696b81f80e4670982 diff --git a/os/os-freebsd.h b/os/os-freebsd.h index 8d965aad..0cb7ae5e 100644 --- a/os/os-freebsd.h +++ b/os/os-freebsd.h @@ -3,17 +3,39 @@ #include #include +#include #define FIO_HAVE_POSIXAIO #define FIO_HAVE_ODIRECT -#define FIO_USE_GENERIC_BDEV_SIZE +#define FIO_HAVE_IOPRIO +#define FIO_HAVE_STRSEP #define FIO_USE_GENERIC_RAND +#define FIO_HAVE_CHARDEV_SIZE +#define FIO_HAVE_CLOCK_MONOTONIC #define OS_MAP_ANON MAP_ANON -typedef unsigned long os_cpu_mask_t; +typedef off_t off64_t; -static inline int blockdev_invalidate_cache(int fd) +static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes) +{ + off_t size; + + if (!ioctl(f->fd, DIOCGMEDIASIZE, &size)) { + *bytes = size; + return 0; + } + + *bytes = 0; + return errno; +} + +static inline int chardev_size(struct fio_file *f, unsigned long long *bytes) +{ + return blockdev_size(f->fd, bytes); +} + +static inline int blockdev_invalidate_cache(struct fio_file *f) { return EINVAL; }