From owner-freebsd-current@FreeBSD.ORG Tue Sep 16 20:41:35 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 609F31065678; Tue, 16 Sep 2008 20:41:35 +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 219058FC12; Tue, 16 Sep 2008 20:41:34 +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 CA707170E4; Tue, 16 Sep 2008 20:41:33 +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 m8GKfXhB075594; Tue, 16 Sep 2008 20:41:33 GMT (envelope-from phk@critter.freebsd.dk) To: John Baldwin From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 16 Sep 2008 16:28:53 -0400." <200809161628.54085.jhb@freebsd.org> Date: Tue, 16 Sep 2008 20:41:33 +0000 Message-ID: <75593.1221597693@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Daniel Eischen , Andrey Chernov , freebsd-current@freebsd.org, 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:41:35 -0000 In message <200809161628.54085.jhb@freebsd.org>, John Baldwin writes: >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). Seems to be a vast overkill to me, in countless other contexts, it is the responsibility of the programmer to do what needs done on a fork, and I see no reason why this couldn't be likewise. The majority of forks don't care a hoot about arc4random() because the call exec after a bit of plumbing on filedescriptors. -- 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.