Whamcloud - gitweb
LU-6081 user: use random() instead of /dev/urandom 77/13277/12
authorPatrick Farrell <paf@cray.com>
Tue, 9 Dec 2014 04:26:28 +0000 (22:26 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 3 Feb 2015 18:00:01 +0000 (18:00 +0000)
commit31e7f22cdc7c77ac7b48ba6a258ca9611063320a
treef507b9ce60c8dabcd967eb5b8e787dfadbb78f2e
parent43f96aa9cc3cec66d9b9e0a03e5fc23e094525e7
LU-6081 user: use random() instead of /dev/urandom

/dev/urandom gives good random numbers, but using it is very prone to
error, and opening/closing the device every time a number is needed
takes time.

Instead, initializes the library with our seed by calling srandom(),
and then use random(). Export a boolean variable
liblustreapi_initialized to let applications check that the library
was properly initialized by the loader.

Signed-off-by: frank zago <fzago@cray.com>
Signed-off-by: Henri Doreau <henri.doreau@cea.fr>
Change-Id: Ie6ced0d39df29d7054919e239add58a23115ec35
Reviewed-on: http://review.whamcloud.com/13277
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lustre/lustreapi.h
lustre/utils/Makefile.am
lustre/utils/lfs.c
lustre/utils/liblustreapi.c
lustre/utils/liblustreapi_util.c [new file with mode: 0644]