Re: Is fork() hook ever possible?
- From: Andrey Chernov <ache@xxxxxxxxxxxx>
- Date: Tue, 16 Sep 2008 18:45:02 +0400
On Tue, Sep 16, 2008 at 03:38:16PM +0100, Bob Bishop wrote:
Hi,
On 16 Sep 2008, at 15:03, Andrey Chernov wrote:
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
getpid().
Any ideas?
How about something hacky using mmap()/minherit()?
Could you please provide working low cost example to detect that we are in
the child (pid changed or something else)? Calling getpid() as OpenBSD
does definitely is very high cost. :(
--
http://ache.pp.ru/
_______________________________________________
freebsd-current@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: Is fork() hook ever possible?
- From: Attilio Rao
- Re: Is fork() hook ever possible?
- References:
- Is fork() hook ever possible?
- From: Andrey Chernov
- Re: Is fork() hook ever possible?
- From: Bob Bishop
- Is fork() hook ever possible?
- Prev by Date: Re: PERC6/i/e cli
- Next by Date: Re: Is fork() hook ever possible?
- Previous by thread: Re: Is fork() hook ever possible?
- Next by thread: Re: Is fork() hook ever possible?
- Index(es):
Relevant Pages
|