]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
random(3): Abstract routines into _r versions on explicit state
authorcem <cem@FreeBSD.org>
Fri, 24 Jan 2020 01:39:29 +0000 (01:39 +0000)
committercem <cem@FreeBSD.org>
Fri, 24 Jan 2020 01:39:29 +0000 (01:39 +0000)
commite7ba8c4571401deecc3094f482608917824fbb2d
treefc183b5f5f256372b4ccfd3ecd9c8c7695870091
parent8ae112b0a8e21f89c3766bc31f793f1436b37d8b
random(3): Abstract routines into _r versions on explicit state

The existing APIs simply pass the implicit global state to the _r variants.

No functional change.

Note that these routines are not exported from libc and are not intended to be
exported.  If someone wished to export them from libc (which I would
discourage), they should first be modified to match the inconsistent parameter
type / order of the glibc public interfaces of the same names.

I know Ravi will ask, so: the eventual goal of this series is to replace
rand(3) with the implementation from random(3) (D23290).  However, I'd like to
wait a bit longer on that one to see if more feedback emerges.

Reviewed by: kevans, markm
Differential Revision: https://reviews.freebsd.org/D23289
lib/libc/stdlib/random.c
lib/libc/stdlib/random.h [new file with mode: 0644]