POSIX::AtFork(3pm) | User Contributed Perl Documentation | POSIX::AtFork(3pm) |
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).
Registeres hooks called before "fork()" (&prepare) and after (&parent for the parent, &child for the child).
All callbacks are called with the current opname, namely "fork", "system", "backtick", and etc.
This exportable function is an interface to pthread_atfork(3).
The same as "pthread_atfork(\&hook, undef, undef)".
The same as "pthread_atfork(undef, \&hook, undef)".
The same as "pthread_atfork(undef, undef, \&hook)".
Deletes &hook from the "prepare" hook list.
Deletes &hook from the "parent" hook list.
Deletes &hook from the "child" hook list.
Fuji, Goro (gfx)
Shulyakovskiy, Nikolay (nikolas)
Copyright (C) 2010 by Fuji, Goro gfx <gfuji@cpan.org>.
Copyright (C) 2020 by Shulyakovskiy, Nikolay nikolas <nikolas@cpan.org>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself,
2022-10-19 | perl v5.36.0 |