Re: [libvirt] PATCH: 21/25: Use random_r for random numbers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 13, 2009 at 05:47:27PM +0000, Daniel P. Berrange wrote:
> Now that gnulib's rand module is imported, we have a decent
> quality random number generator that's portable. We don't
> want to mess with the apps state, so in virInitialize() we
> explicitly initialize our own private random nubmer generator
> state with virRandomInitialize().
> 
> The util.h file gains a convenience macro, since random_r()
> is horrible to call and we need to protect our global state
> 
>    int virRandom(int max)

+1.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]