projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix FreeBSD support
[fio.git]
/
os
/
os-freebsd.h
diff --git
a/os/os-freebsd.h
b/os/os-freebsd.h
index e517ec0f261f5ae618ac1395a52d581c3a15b541..8d965aadf87ec84372f83bd07029f2e414c35992 100644
(file)
--- a/
os/os-freebsd.h
+++ b/
os/os-freebsd.h
@@
-6,25
+6,12
@@
#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 OS_MAP_ANON MAP_ANON
typedef unsigned long os_cpu_mask_t;
#define OS_MAP_ANON MAP_ANON
typedef unsigned long os_cpu_mask_t;
-typedef unsigned int os_random_state_t;
-
-/*
- * FIXME
- */
-static inline int blockdev_size(int fd, unsigned long long *bytes)
-{
- 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)
{
static inline int blockdev_invalidate_cache(int fd)
{
@@
-41,17
+28,8
@@
static inline unsigned long long os_phys_mem(void)
return mem;
}
return mem;
}
-static inline void os_random_seed(unsigned long seed, os_random_state_t *rs)
-{
- srand(seed);
-}
-
-static inline long os_random_long(os_random_state_t *rs)
-{
- long val;
-
- val = rand_r(rs);
- return val;
-}
+#ifdef MADV_FREE
+#define FIO_MADV_FREE MADV_FREE
+#endif
#endif
#endif