[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [libvirt] PATCH: 21/25: Use random_r for random numbers
- From: Daniel Veillard <veillard redhat com>
- To: "Daniel P. Berrange" <berrange redhat com>
- Cc: libvir-list redhat com
- Subject: Re: [libvirt] PATCH: 21/25: Use random_r for random numbers
- Date: Fri, 16 Jan 2009 16:43:19 +0100
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 looks fine !
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel veillard com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]