From owner-freebsd-current@FreeBSD.ORG Tue Sep 16 14:03:27 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60C1F1065673 for ; Tue, 16 Sep 2008 14:03:27 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id D1CEC8FC1E for ; Tue, 16 Sep 2008 14:03:26 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id m8GE3OPH036203 for ; Tue, 16 Sep 2008 18:03:24 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1221573804; bh=5jkWtRLxW+m5gdQ9pQMOdIdMAXhgpFspzYKDvA0 Ll/A=; l=427; h=Date:From:To:Subject:Message-ID:MIME-Version: Content-Type; b=F8+p8D2mOy8IRErx4slVCK4E8p5OAiTsjICr/qbT14ismRHONQ OQZxtUKHSg80JSFYh7EXP+ugkZEidfLKhufocbM3H5X6XURnIfUj+cFwD7p1OHZxMG5 EZPSDXDlbFCg0sDrNDAW/fuPkQFqeRGYUl1QRx38Hvh8u7KcxwN9C4= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id m8GE3Lci036202 for current@freebsd.org; Tue, 16 Sep 2008 18:03:21 +0400 (MSD) (envelope-from ache) Date: Tue, 16 Sep 2008 18:03:20 +0400 From: Andrey Chernov To: current@freebsd.org Message-ID: <20080916140319.GA34447@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Cc: Subject: 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 14:03:27 -0000 I need some sort of fork() hook to detect that pid is changed to re-stir ar4random() after that (in the child), simple flag variable with child's pid is needed. Currently OpenBSD does almost that checking getpid() every time arc4random() called, but it is very slow way to use getpid() syscall repeatedly, about 12-15 times slower than just arc4random() without getpid(). Any ideas? -- http://ache.pp.ru/