From owner-freebsd-current@FreeBSD.ORG Tue Sep 16 20:11: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 9508E106564A; Tue, 16 Sep 2008 20:11:21 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 589568FC2E; Tue, 16 Sep 2008 20:11:21 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 58F32170E4; Tue, 16 Sep 2008 19:42:19 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.2/8.14.2) with ESMTP id m8GJgIQa074568; Tue, 16 Sep 2008 19:42:18 GMT (envelope-from phk@critter.freebsd.dk) To: Andrey Chernov From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 16 Sep 2008 23:33:47 +0400." <20080916193347.GA43665@nagual.pp.ru> Date: Tue, 16 Sep 2008 19:42:18 +0000 Message-ID: <74567.1221594138@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Daniel Eischen , Max Laier , freebsd-current@freebsd.org 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:11:21 -0000 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 ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.