From owner-freebsd-current@FreeBSD.ORG Tue Sep 16 20:33:21 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A4A6106564A; Tue, 16 Sep 2008 20:33:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id CE17E8FC17; Tue, 16 Sep 2008 20:33:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m8GKXE4u097161; Tue, 16 Sep 2008 16:33:14 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-current@freebsd.org Date: Tue, 16 Sep 2008 16:28:53 -0400 User-Agent: KMail/1.9.7 References: <74567.1221594138@critter.freebsd.dk> In-Reply-To: <74567.1221594138@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200809161628.54085.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Tue, 16 Sep 2008 16:33:14 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/8265/Tue Sep 16 15:26:49 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Daniel Eischen , Andrey Chernov , Poul-Henning Kamp , Max Laier Subject: Re: Is fork() hook ever possible? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2008 20:33:21 -0000 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