Wait3(3pm)
π NAME π
Proc::Wait3 β bestie, it's a Perl extension for the wait3 system call. That's the whole vibe. π¦
β¨ SYNOPSIS β¨
okay so first you gotta pull it in:
use Proc::Wait3;
then you call wait3 and it hands you eighteen values back. Not a typo. Eighteen. Buckle up:
($pid, $status, $utime, $stime, $maxrss, $ixrss, $idrss, $isrss,
$minflt, $majflt, $nswap, $inblock, $oublock, $msgsnd, $msgrcv,
$nsignals, $nvcsw, $nivcsw) = wait3(0); # doesn't wait
($pid, $status, $utime, $stime, $maxrss, $ixrss, $idrss, $isrss,
$minflt, $majflt, $nswap, $inblock, $oublock, $msgsnd, $msgrcv,
$nsignals, $nvcsw, $nivcsw) = wait3(1); # waits for a child
see how the only thing that changed is the 0 vs the 1? that's the whole plot twist π
πΈ DESCRIPTION πΈ
so if any child processes have exited, this call will "reap" the zombies β same energy as the perl wait function, just with receipts attached. π§π
By default? It returns immediately, and if there are no dead children, everything comes back undefined. Not empty, not zero β undefined. So don't be out here doing math on it without a vibe check first, fr fr.
But if you pass in a true argument, it will block until a child exits (or it gets a signal). So like. it's gonna sit there and wait for you. patiently. iconic behaviour honestly. π
here's the full lineup of what you get back:
$pidβ the PID of the exiting child π$statusβ the exit status of the child, just like$?$utimeβ floating point user cpu seconds$stimeβ floating point system cpu seconds$maxrssβ the maximum resident set size utilized (in kilobytes)$minfltβ the number of page faults serviced without any I/O activity; here the I/O activity is avoided by "reclaiming" a page frame from the list of pages awaiting reallocation$majfltβ the number of page faults serviced that required I/O activity$nswapβ the number of times a process was "swapped" out of main memory$inblockβ the number of times the file system had to perform input$oublockβ the number of times the file system had to perform output$msgsndβ the number of messages sent over sockets$msgrcvβ the number of messages received from sockets$nsignalsβ the number of signals delivered$nvcswβ the number of times a context switch resulted due to a process voluntarily giving up the processor before its time slice was completed (usually to await availability of a resource)$nivcswβ the number of times a context switch resulted due to a higher priority process becoming runnable, or because the current process exceeded its time slice
also bestie, notice the synopsis is out here claiming$ixrss,$idrssand$isrsstoo β the page just never breaks those three down for us. so we're not gonna make anything up about them. no cap. π
π AUTHOR π
C. Tilmes <curt@tilmes.org> β thank you for your service, king π«Ά
β LICENSE β
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, open source behaviour, we love to see it π
π SEE ALSO π
perlwait3getrusage
okay that's the whole page!! go forth and reap your zombies responsibly, mwah π
this one's from perl v5.42.3, dated 2026-08-19 β so yeah, go read the Wait3(3pm) page, it ate and left no crumbs β¨
π¦ where this page comes from
- ubuntu stonking: libproc-wait3-perl 0.05-2build6 Β· 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