From owner-freebsd-current@FreeBSD.ORG Tue Sep 16 15:00:44 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 D86671065670 for ; Tue, 16 Sep 2008 15:00:44 +0000 (UTC) (envelope-from rb@gid.co.uk) Received: from mx0.gid.co.uk (mx0.gid.co.uk [194.32.164.250]) by mx1.freebsd.org (Postfix) with ESMTP id 74BB58FC20 for ; Tue, 16 Sep 2008 15:00:38 +0000 (UTC) (envelope-from rb@gid.co.uk) Received: from gidgate.gid.co.uk (80-46-130-69.static.dsl.as9105.com [80.46.130.69]) by mx0.gid.co.uk (8.14.2/8.14.2) with ESMTP id m8GEcRl9092544; Tue, 16 Sep 2008 15:38:27 +0100 (BST) (envelope-from rb@gid.co.uk) Received: from [192.168.2.3] (host81-151-132-23.range81-151.btcentralplus.com [81.151.132.23]) by gidgate.gid.co.uk (8.13.8/8.13.8) with ESMTP id m8GEcLTw041100; Tue, 16 Sep 2008 15:38:21 +0100 (BST) (envelope-from rb@gid.co.uk) Message-Id: From: Bob Bishop To: Andrey Chernov In-Reply-To: <20080916140319.GA34447@nagual.pp.ru> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Date: Tue, 16 Sep 2008 15:38:16 +0100 References: <20080916140319.GA34447@nagual.pp.ru> X-Mailer: Apple Mail (2.929.2) Cc: 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 15:00:44 -0000 Hi, On 16 Sep 2008, at 15:03, Andrey Chernov wrote: > 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? How about something hacky using mmap()/minherit()? > -- > http://ache.pp.ru/ > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org > " > -- Bob Bishop rb@gid.co.uk