On 2002-Jan-20 21:51:07 +0000, Mark Murray <[EMAIL PROTECTED]> wrote:
>> > Second step is effectively damages srandom(3) RNG state.
>> 
>> Since the library is a totally encapsulated usage, it makes sense
>> for it to save and restore state aroun its use of the functions,
>> which would effectively allow concurrent use of the generator
>> with other code that uses it.
>> 
>> Other code that cares about the state should do the same.
>
>True but not trivial. I'd be happy to commit working patches :-)

The simplest solution would appear to be to add srandom_r() and
random_r() functions - both of which take an initstate() buffer.
It should be possible using setstate() but there doesn't appear
to be a documented sequence to restore the internal random state
to "uninitialised".

Is there any good reason why random_r(), srandom_r(), srandomdev_r()
should not exist?

Peter

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to