Is fork() hook ever possible?

Andrey Chernov ache at
Wed Sep 17 09:01:05 UTC 2008

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 


More information about the freebsd-current mailing list