projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix FreeBSD warning
[fio.git]
/
os
/
os-freebsd.h
diff --git
a/os/os-freebsd.h
b/os/os-freebsd.h
index 062c44cdc3363c5ee6436257a78530f1e08bb221..bb7e9a3b0697a0d1c0eb25858126677858d1355f 100644
(file)
--- a/
os/os-freebsd.h
+++ b/
os/os-freebsd.h
@@
-3,16
+3,28
@@
#include <errno.h>
#include <sys/sysctl.h>
#include <errno.h>
#include <sys/sysctl.h>
+#include <sys/disk.h>
#define FIO_HAVE_POSIXAIO
#define FIO_HAVE_ODIRECT
#define FIO_HAVE_POSIXAIO
#define FIO_HAVE_ODIRECT
-#define FIO_USE_GENERIC_BDEV_SIZE
#define FIO_USE_GENERIC_RAND
#define FIO_USE_GENERIC_RAND
-#define FIO_HAVE_FDATASYNC
#define OS_MAP_ANON MAP_ANON
#define OS_MAP_ANON MAP_ANON
-typedef unsigned long os_cpu_mask_t;
+typedef off_t off64_t;
+
+static inline int blockdev_size(int fd, unsigned long long *bytes)
+{
+ off_t size;
+
+ if (!ioctl(fd, DIOCGMEDIASIZE, &size)) {
+ *bytes = size;
+ return 0;
+ }
+
+ *bytes = 0;
+ return errno;
+}
static inline int blockdev_invalidate_cache(int fd)
{
static inline int blockdev_invalidate_cache(int fd)
{