#ifndef FIO_OS_FREEBSD_H
#define FIO_OS_FREEBSD_H
+#include <errno.h>
#include <sys/sysctl.h>
#define FIO_HAVE_POSIXAIO
*/
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)