From owner-freebsd-current@FreeBSD.ORG Wed Sep 17 09:01:04 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 4C30D1065677; Wed, 17 Sep 2008 09:01:04 +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 B094D8FC24; Wed, 17 Sep 2008 09:01:03 +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 m8H912YQ058835; Wed, 17 Sep 2008 13:01:02 +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=1221642062; bh=CIQR8LAP+/b6qM+w9RM8RpohPY7A3JFAckDaFy6 lmu8=; l=879; h=Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=cG8xkUmwb9wlo80yafHV6SKHS vwOoh7iwFer/ufMN/7pkC8aqfJH+y4EuugAi7zkntvYbs6YygvLZh7M+2rqr5g/TTpZ FRecqfVNhCSLp9Z88NgB8Xz3aklquO+yzPIqwavOi/IeqjiJWvdp47z1k5U1PbxuRw+ /Z70eZ8AWN28= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id m8H912mY058834; Wed, 17 Sep 2008 13:01:02 +0400 (MSD) (envelope-from ache) Date: Wed, 17 Sep 2008 13:01:01 +0400 From: Andrey Chernov To: Poul-Henning Kamp Message-ID: <20080917090101.GC57480@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Poul-Henning Kamp , Daniel Eischen , Max Laier , freebsd-current@freebsd.org References: <20080917075513.GB55535@nagual.pp.ru> <89506.1221638697@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <89506.1221638697@critter.freebsd.dk> User-Agent: Mutt/1.5.18 (2008-05-17) 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: Wed, 17 Sep 2008 09:01:05 -0000 On Wed, Sep 17, 2008 at 08:04:57AM +0000, Poul-Henning Kamp wrote: > >The situation is not so simple since the library functions can call > >ar4random() internally (like mktemp() family already and always does) > > I have a really hard time seeing how this could become a performance > issue, ever. The performance issue happens when application tries to call arc4random() in the loop. > The solution however, is simple: Just have these hidden library calls > to arc4random call a wrapper function that does the pid check. We can control our own arc4random() internal calls inside our own libs in such way but can't control 3rd party libs or programs arc4random() calls (consider ports). There is no special mentions of pid check needed in arc4random() general API, so 3rd party code will tends to not come to that matter. -- http://ache.pp.ru/