POSIX::AtFork(3pm)
π POSIX::AtFork π
okay bestie, listen. the manual page is POSIX::AtFork(3pm) (user contributed perl documentation, if you're keeping score) and it is literally the little module that hooks you up at fork(2). fork hook registrations!! we love a before-and-after situation. π
β¨ NAME β¨
POSIX::AtFork β hook registrations at fork(2). that's it, that's the whole name, and it ate. π
πΈ SYNOPSIS πΈ
here's the vibe, copied exactly, no cap:
# 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);
yes you can register, yes you can delete, yes we're doing both. main character energy fr fr. π
π¦ DESCRIPTION π¦
so like. this module is an interface to pthread_atfork(3), and what that does is register handlers that get called before and after fork(2). that's the whole point. before. after. slay. π
π INTERFACE π
pthread_atfork(\&prepare, \&parent, \&child)
registers hooks called before fork() (that's &prepare) and after β &parent for the parent, &child for the child. three slots, one function, iconic behavior.
all callbacks are called with the current opname, namely "fork", "system", "backtick", and etc. so yes, they know what you did. π«Ά
this exportable function is an interface to pthread_atfork(3).
POSIX::AtFork->add_to_prepare(\&hook)
the same as "pthread_atfork(\&hook, undef, undef)".
POSIX::AtFork->add_to_parent(\&hook)
the same as "pthread_atfork(undef, \&hook, undef)".
POSIX::Atfork->add_to_child(\&hook)
the same as "pthread_atfork(undef, undef, \&hook)".
POSIX::AtFork->delete_from_prepare(\&hook)
deletes &hook from the "prepare" hook list. bye bestie π
POSIX::AtFork->delete_from_parent(\&hook)
deletes &hook from the "parent" hook list.
POSIX::AtFork->delete_from_child(\&hook)
deletes &hook from the "child" hook list.
π SEE ALSO π
go read them, iykyk. π
π AUTHORS π
- Fuji, Goro (gfx)
- Shulyakovskiy, Nikolay (nikolas)
two legends, one module. π₯
π COPYRIGHT AND LICENSE π
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,
okay so like, legal girlie moment: those copyright lines are doing the lord's work and you should not touch them. redistribute and/or modify responsibly bestie. π
and that's the whole page, bestie!! this was perl v5.42.3, dated 2026-08-19, and it lives at POSIX::AtFork(3pm) forever and ever. go forth and fork safely, no cap. βπ§π
π¦ where this page comes from
- ubuntu stonking: libposix-atfork-perl 0.04-2build7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms