Re: Is fork() hook ever possible?

From: Andrey Chernov <ache_at_nagual.pp.ru>
Date: Wed, 17 Sep 2008 13:45:43 +0400
On Wed, Sep 17, 2008 at 09:34:12AM +0000, Poul-Henning Kamp wrote:
> In message <20080917093238.GA59500_at_nagual.pp.ru>, Andrey Chernov writes:
> >On Wed, Sep 17, 2008 at 09:24:01AM +0000, Poul-Henning Kamp wrote:
> 
> >> 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.
> 
> Well, in that case, you should leave the "slow" check in place and
> live with it.

Not so doomed. As already discussed in this thread we can ether:

a) Add *fork() hook to clear arc4random's flag which inidicates it is 
stired (to re-stir it on the next call). This slightly increases diffs 
with OpenBSD arc4random code.

b) Speed up getpid() itself by caching its value (adding *fork() and 
getpid() hooks). This produces no diffs with OpenBSD arc4random code. That 
way give more benefits for other program that calls getpid() often to 
check they are in the child, but I don't have examples.

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

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