Brad King wrote:
> On 12/14/2014 08:36 AM, Rolf Eike Beer wrote:
> > The idea behind this API in OpenBSD is: if you are looking for the pseudo
> > numbers you need to call srand_deterministic(), i.e. you must explicitely
> > state that you want the not really random random numbers. Everyone else
> > will get real random.
> 
> CMake uses /dev/urandom on POSIX and wincrypt APIs on Windows to choose
> the seed specifically to get "really" random behavior.  The *only* reason
> we continue to use s/rand() at all is to support the RANDOM_SEED API in
> string(RANDOM), AFAIK.
> 
> One approach to dealing with this is to refactor the implementation of
> string(RANDOM) to use non-deterministic APIs until RANDOM_SEED is used
> and then use deterministic APIs after that.  That will get better random
> values by default but still honor the existing API when it is used.

Which is what we would get if we do not call srand_deterministic() on OpenBSD 
afaict. We would get weaker random numbers on other platforms, but I doubt 
this matters at all.

Eike
-- 

Attachment: signature.asc
Description: This is a digitally signed message part.

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to