diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2009-12-15 10:28:37 +0100 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-12-15 10:28:37 +0100 |
commit | 535313705d69dc16f27ca38acf2f9bf7205e410d (patch) | |
tree | db57c488c22530b5031924fd066f307cc4535306 /os/os-freebsd.h | |
parent | 3b2e1464ae58caf42c74ab4bdeaa5eae7c38a23f (diff) | |
download | fio-535313705d69dc16f27ca38acf2f9bf7205e410d.tar.gz fio-535313705d69dc16f27ca38acf2f9bf7205e410d.tar.bz2 |
Add generic random helpers
FreeBSD and OSX can both use these.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'os/os-freebsd.h')
-rw-r--r-- | os/os-freebsd.h | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/os/os-freebsd.h b/os/os-freebsd.h index f4c5e235..8d965aad 100644 --- a/os/os-freebsd.h +++ b/os/os-freebsd.h @@ -7,11 +7,11 @@ #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; -typedef unsigned int os_random_state_t; static inline int blockdev_invalidate_cache(int fd) { @@ -28,19 +28,6 @@ static inline unsigned long long os_phys_mem(void) 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 |