Is fork() hook ever possible?

Andrey Chernov ache at
Tue Sep 16 14:03:27 UTC 2008

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 

Any ideas?


More information about the freebsd-current mailing list