Date: Tue, 16 Sep 2008 16:28:53 -0400 From: John Baldwin <jhb@freebsd.org> To: freebsd-current@freebsd.org Cc: Daniel Eischen <deischen@freebsd.org>, Andrey Chernov <ache@nagual.pp.ru>, Poul-Henning Kamp <phk@phk.freebsd.dk>, Max Laier <max@love2party.net> Subject: Re: Is fork() hook ever possible? Message-ID: <200809161628.54085.jhb@freebsd.org> In-Reply-To: <74567.1221594138@critter.freebsd.dk> References: <74567.1221594138@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 16 September 2008 03:42:18 pm Poul-Henning Kamp wrote: > In message <20080916193347.GA43665@nagual.pp.ru>, Andrey Chernov writes: > > >That was my original idea - to set the flag variable (not a new inteface) > >in the fork() wrapper which arc4random() will check later. I'll think > >about, what is better: getpid() speedup looks like more general solution > >for all similar cases while the flag will be for arc4random() only. > > Not to be devils advocate here, but isn't the process pid about the > worst seed you can use for a random generator, considering that it > is publically visible ? The PID isn't the seed, he's using a PID change as a notification that the process needs to do a re-stir the next time it wants a psuedo-random number (b/c the PID change means it is now a new process). -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809161628.54085.jhb>