[libdispatch-dev] libdispatch compiles under Linux but arc4random(3) is missing

Robert Watson robert at fledge.watson.org
Tue Nov 17 04:01:11 PST 2009

On Mon, 16 Nov 2009, Paolo Bonzini wrote:

> On 11/16/2009 01:58 PM, Robert N. M. Watson wrote:
>> The rand(3) and random(3) APIs have well-defined characteristics with 
>> respect to repeatable behavior given a specific seed. If libdispatch uses 
>> srand(),rand(), it may interfere with the application's use of the same 
>> interfaces, replacing the application's seeding and consuming numbers from 
>> the sequence so that they are no longer returned to the application. 
>> Consider, for example, a simulator that accepts a seed as an argument so 
>> that the same sequence can be replayed.
> That's in the test harness though, not in libdispatch.

Indeed.  :-)

Robert N M Watson
Computer Laboratory
University of Cambridge

More information about the libdispatch-dev mailing list