path: root/os/os-freebsd.h
diff options
authorJens Axboe <>2007-07-26 11:55:10 +0200
committerJens Axboe <>2007-07-26 11:55:10 +0200
commit4c5946c6606abc87ba7e2bfc57a5030d19b6d4d5 (patch)
tree7964b20b7aaaa6bf6aaf210c2f3fbd98e894702b /os/os-freebsd.h
parent47f0cc48db34b37d81540b31bf6adf11bb7b578d (diff)
Fix verify random bytes filling
Shawn Lewis <> reports: --- verify.c: fill_random_bytes() doesn't work as intended. drand48 on linux returns a double whose value is evenly distributed between 0.0 and 0.1. This is not the same as having an 8-byte value where each bit has the same chance of being 0 as it does of being 1. I'd fix this but it should probably be done in a cross-platformish way and I'm not quite sure how to do it. Maybe just use smaller randoms? Have an os_random_uint32? --- I just got rid of os_random_double() and used os_random_long(), truncating that to an unsigned integer. Signed-off-by: Jens Axboe <>
Diffstat (limited to 'os/os-freebsd.h')
1 files changed, 0 insertions, 7 deletions
diff --git a/os/os-freebsd.h b/os/os-freebsd.h
index 01c5ce91..ba2541a5 100644
--- a/os/os-freebsd.h
+++ b/os/os-freebsd.h
@@ -52,11 +52,4 @@ static inline long os_random_long(os_random_state_t *rs)
return val;
-static inline double os_random_double(os_random_state_t *rs)
- double val;
- val = (double) rand_r(rs);
- return val;