Re: Is fork() hook ever possible?

From: Andrey Chernov <ache_at_nagual.pp.ru>
Date: Wed, 17 Sep 2008 13:32:40 +0400
On Wed, Sep 17, 2008 at 09:24:01AM +0000, Poul-Henning Kamp wrote:
> >The performance issue happens when application tries to call arc4random() 
> >in the loop.
> 
> That is not what we are talking about, we are talking about the calls
> in mktemp and similar.

There are two things needed to be separated. mktemp etc. calls are the 
reason for the check. The check (in its current form) is the reason for 
slowing down in the loops because syscall overhead.

> >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).
> 
> We are not obliged to control these calls.  If their authors do something
> stupid, it's not our problem.

The problem is that we are not authors of that API but currently OpenBSD 
are. We just integrate their API. Perhaps their API is stupid in this 
point (so they resolve it by non-efficient way), but people will try to 
follow their API because they are the authors, not ours.

> Just have the FreeBSD library calls, call the wrapper function that
> does a pid check and be done with it.

I understand your idea and it was first idea that comes to me too, but 
since API is not ours, it does not work that way.

-- 
http://ache.pp.ru/
Received on Wed Sep 17 2008 - 07:32:44 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:35 UTC