summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/random.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib/random.c')
-rw-r--r--lib/libc/stdlib/random.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/libc/stdlib/random.c b/lib/libc/stdlib/random.c
index f299d8e2f65..00edf2dca1c 100644
--- a/lib/libc/stdlib/random.c
+++ b/lib/libc/stdlib/random.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: random.c,v 1.18 2013/03/15 19:07:53 tedu Exp $ */
+/* $OpenBSD: random.c,v 1.19 2013/08/01 19:42:08 kettenis Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved.
@@ -233,6 +233,11 @@ srandom(unsigned int x)
UNLOCK();
}
+#if defined(APIWARN)
+__warn_references(srandom,
+ "warning: srandom() seed choices are invariably poor");
+#endif
+
/*
* srandomdev:
*
@@ -267,6 +272,11 @@ srandomdev(void)
UNLOCK();
}
+#if defined(APIWARN)
+__warn_references(srandomdev,
+ "warning: srandomdev() usage; consider switching to arc4random()");
+#endif
+
/*
* initstate:
*
@@ -429,3 +439,8 @@ random(void)
UNLOCK();
return r;
}
+
+#if defined(APIWARN)
+__warn_references(random,
+ "warning: random() isn't random; consider using arc4random()");
+#endif