From: Jens Axboe Date: Thu, 26 Jul 2007 09:55:10 +0000 (+0200) Subject: Fix verify random bytes filling X-Git-Tag: fio-1.17~50 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=4c5946c6606abc87ba7e2bfc57a5030d19b6d4d5;hp=4c5946c6606abc87ba7e2bfc57a5030d19b6d4d5 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 ---