| 1 | package Linux::Event::Fork::Exit; | ||||||||||
| 2 | 40 | ▶ | use v5.36; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 40 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 40 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 40 | our $VERSION = '0.007'; | |||||||||
| 7 | |||||||||||
| 8 | 40 | ▶ | use POSIX qw(WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | # WCOREDUMP is not available/exported on all Perls/platforms. | ||||||||||
| 11 | # Detect it at compile time and gracefully return 0 when unavailable. | ||||||||||
| 12 | 40 | ▶ | my $HAS_WCOREDUMP = defined &POSIX::WCOREDUMP ? 1 : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | |||||||||||
| 14 | ▶ | sub new ($class, $pid, $status) { | |||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 15 | 43 | return bless { pid => $pid, status => $status }, $class; | |||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | 0 | ▶ | sub pid ($self) { return $self->{pid} } | ||||||||
|
Subroutine
pid: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 19 | 0 | ▶ | sub status ($self) { return $self->{status} } | ||||||||
|
Subroutine
status: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 20 | |||||||||||
| 21 | 13 | ▶ | sub exited ($self) { return WIFEXITED($self->{status}) ? 1 : 0 } | ||||||||
|
Subroutine
exited: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||
| 22 | 13 | ▶ | sub code ($self) { return WEXITSTATUS($self->{status}) } | ||||||||
|
Subroutine
code: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 23 | |||||||||||
| 24 | 1 | ▶ | sub signaled ($self) { return WIFSIGNALED($self->{status}) ? 1 : 0 } | ||||||||
|
Subroutine
signaled: called CC=2 SCAR=7.6
Pod
documented
Branch: 1 branch
| |||||||||||
| 25 | 0 | ▶ | sub signal ($self) { return WTERMSIG($self->{status}) } | ||||||||
|
Subroutine
signal: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 26 | |||||||||||
| 27 | ▶ | sub coredump ($self) { | |||||||||
|
Subroutine
coredump: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 28 | 0 | ▶ | return 0 if !$HAS_WCOREDUMP; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | 0 | ▶ | return POSIX::WCOREDUMP($self->{status}) ? 1 : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 40 | 1; | |||||||||
| 33 | |||||||||||
| 34 | __END__ | ||||||||||