summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/random.3
diff options
context:
space:
mode:
authorotto <>2005-11-30 07:51:02 +0000
committerotto <>2005-11-30 07:51:02 +0000
commitf8452f05564b5820c3745b9348d85a2b3a745467 (patch)
tree803b53c012ae878cdf973f67d5346e2452f9e177 /src/lib/libc/stdlib/random.3
parent75ccbec66ef4157baa8c840a64a98a73287280fb (diff)
downloadopenbsd-f8452f05564b5820c3745b9348d85a2b3a745467.tar.gz
openbsd-f8452f05564b5820c3745b9348d85a2b3a745467.tar.bz2
openbsd-f8452f05564b5820c3745b9348d85a2b3a745467.zip
Use sysctl(KERN_ARND) to get n bytes, instead of just 4 at a time
and remove fallback code. If somebody is dumb enough to make the sysctl fail using systrace, he deserves what he gets. Saves 7 syscalls on process startup. looks good miod@ ok deraadt@ tedu@
Diffstat (limited to 'src/lib/libc/stdlib/random.3')
-rw-r--r--src/lib/libc/stdlib/random.37
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/libc/stdlib/random.3 b/src/lib/libc/stdlib/random.3
index f43f06420d..626b040b50 100644
--- a/src/lib/libc/stdlib/random.3
+++ b/src/lib/libc/stdlib/random.3
@@ -25,7 +25,7 @@
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE. 26.\" SUCH DAMAGE.
27.\" 27.\"
28.\" $OpenBSD: random.3,v 1.17 2003/06/02 20:18:38 millert Exp $ 28.\" $OpenBSD: random.3,v 1.18 2005/11/30 07:51:02 otto Exp $
29.\" 29.\"
30.Dd April 19, 1991 30.Dd April 19, 1991
31.Dt RANDOM 3 31.Dt RANDOM 3
@@ -89,9 +89,8 @@ as the seed.
89.Pp 89.Pp
90The 90The
91.Fn srandomdev 91.Fn srandomdev
92routine initializes a state array using the 92routine initializes a state array using
93.Xr arandom 4 93random numbers obtained from the kernel,
94random number device which returns good random numbers,
95suitable for cryptographic use. 94suitable for cryptographic use.
96Note that this particular seeding procedure can generate 95Note that this particular seeding procedure can generate
97states which are impossible to reproduce by calling 96states which are impossible to reproduce by calling