#ifndef FIO_OS_FREEBSD_H
#define FIO_OS_FREEBSD_H
+#include <errno.h>
#include <sys/sysctl.h>
-#undef FIO_HAVE_LIBAIO
#define FIO_HAVE_POSIXAIO
-#undef FIO_HAVE_FADVISE
-#undef FIO_HAVE_CPU_AFFINITY
-#undef FIO_HAVE_DISK_UTIL
-#undef FIO_HAVE_SGIO
#define FIO_HAVE_ODIRECT
-#define OS_MAP_ANON (MAP_ANON)
+#define OS_MAP_ANON MAP_ANON
typedef unsigned long os_cpu_mask_t;
typedef unsigned int 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)