svn commit: r356097 - in head: share/man/man9 sys/compat/ndis sys/dev/oce sys/kern sys/libkern sys/sys

Hans Petter Selasky hps at selasky.org
Mon Jan 6 14:35:20 UTC 2020


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


More information about the svn-src-all mailing list