Date: Mon, 6 Jan 2020 15:34:07 +0100 From: Hans Petter Selasky <hps@selasky.org> To: Conrad Meyer <cem@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356097 - in head: share/man/man9 sys/compat/ndis sys/dev/oce sys/kern sys/libkern sys/sys Message-ID: <baea281b-c3d9-b2dc-03c0-333f8457f0b6@selasky.org> In-Reply-To: <201912261941.xBQJf9mL053706@repo.freebsd.org> References: <201912261941.xBQJf9mL053706@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2019-12-26 20:41, Conrad Meyer wrote: > Author: cem > Date: Thu Dec 26 19:41:09 2019 > New Revision: 356097 > URL: https://svnweb.freebsd.org/changeset/base/356097 > > Log: > random(9): Deprecate random(9), remove meaningless srandom(9) > > srandom(9) is meaningless on SMP systems or any system with, say, > interrupts. One could never rely on random(9) to produce a reproducible > sequence of outputs on the basis of a specific srandom() seed because the > global state was shared by all kernel contexts. As such, removing it is > literally indistinguishable to random(9) consumers (as compared with > retaining it). > > Mark random(9) as deprecated and slated for quick removal. This is not to > say we intend to remove all fast, non-cryptographic PRNG(s) in the kernel. > It/they just won't be random(9), as it exists today, in either name or > implementation. > > Before random(9) is removed, a replacement will be provided and in-tree > consumers will be converted. > > Note that despite the name, the random(9) interface does not bear any > resemblance to random(3). Instead, it is the same crummy 1988 Park-Miller > LCG used in libc rand(3). > Hi, Having some kind of replacment for this using atomics(), might be useful for system testing. Sometimes you need a white-noise function for initializing test parameters and you also need srandom to reproducue failing tests. --HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?baea281b-c3d9-b2dc-03c0-333f8457f0b6>