diff options
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r-- | lib/libc/stdlib/rand.c | 4 | ||||
-rw-r--r-- | lib/libc/stdlib/random.c | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c index 00390a23e78..ee2fd44bac6 100644 --- a/lib/libc/stdlib/rand.c +++ b/lib/libc/stdlib/rand.c @@ -42,7 +42,7 @@ rand_r(u_int *seed) #if defined(APIWARN) __warn_references(rand_r, - "warning: rand_r() isn't random; consider using arc4random()"); + "warning: rand_r() is not random, it is deterministic."); #endif int @@ -55,7 +55,7 @@ rand(void) #if defined(APIWARN) __warn_references(rand, - "warning: rand() isn't random; consider using arc4random()"); + "warning: rand() may return determinstic values, is that what you want?"); #endif void diff --git a/lib/libc/stdlib/random.c b/lib/libc/stdlib/random.c index cba088c7514..375bfbd0e67 100644 --- a/lib/libc/stdlib/random.c +++ b/lib/libc/stdlib/random.c @@ -1,4 +1,4 @@ -/* $OpenBSD: random.c,v 1.25 2014/12/08 21:45:20 deraadt Exp $ */ +/* $OpenBSD: random.c,v 1.26 2014/12/09 08:00:53 deraadt Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. @@ -415,3 +415,8 @@ random(void) UNLOCK(); return r; } + +#if defined(APIWARN) +__warn_references(rand, + "warning: random() may return determinstic values, is that what you want?"); +#endif |