POSIX::AtFork - Hook registrations at fork(2)
# POSIX interface: use POSIX::AtFork qw(:all); pthread_atfork(\&prepare, \&parent, \&child); # or per-hook interfaces: POSIX::AtFork->add_to_prepare(\&prepare); POSIX::AtFork->add_to_parent(\&parent); POSIX::AtFork->add_to_child(\&child); # registered callbacks can be removed POSIX::AtFork->delete_from_prepare(\&prepare); POSIX::AtFork->delete_from_parent( \&parent); POSIX::AtFork->delete_from_child( \&child);
This module is an interface to pthread_atfork(3) which registeres handlers called before and after fork(2).
pthread_atfork(3)
fork(2)
This exportable function is an interface to pthread_atfork(3).
Registeres hooks called before fork() (&prepare) and after (&parent for the parent, &child for the child).
fork()
All callbacks are called with the current opname, namely fork, system, backtick, and etc.
fork
system
backtick
The same as pthread_atfork(\&hook, undef, undef).
pthread_atfork(\&hook, undef, undef)
The same as pthread_atfork(undef, \&hook, undef).
pthread_atfork(undef, \&hook, undef)
The same as pthread_atfork(undef, undef, \&hook).
pthread_atfork(undef, undef, \&hook)
Deletes &hook from the prepare hook list.
prepare
Deletes &hook from the parent hook list.
parent
Deletes &hook from the child hook list.
child
pthread_atfork(3).
Fuji, Goro (gfx)
Copyright (C) 2010 by Fuji, Goro gfx <gfuji@cpan.org>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself,
To install POSIX::AtFork, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POSIX::AtFork
CPAN shell
perl -MCPAN -e shell install POSIX::AtFork
For more information on module installation, please visit the detailed CPAN module installation guide.