diff options
author | Robert Rothenberg <rrwo@cpan.org> | 2020-03-29 12:51:59 +0100 |
---|---|---|
committer | Robert Rothenberg <rrwo@cpan.org> | 2020-03-29 12:51:59 +0100 |
commit | a87be377dd2a3eb781362741939dfe7146dfd697 (patch) | |
tree | 845e13a2b782c60455f63d5204e5b8f45ca3e248 | |
parent | 9e1ceb7c48d44c6ae6fc25d8dbdaba1ef2bc1f56 (diff) |
Add getloadavg support for DragonFly BSD
-rw-r--r-- | Changes | 2 | ||||
-rw-r--r-- | CpuLoad.xs | 2 | ||||
-rw-r--r-- | lib/Sys/CpuLoad.pm | 2 | ||||
-rw-r--r-- | t/10-getloadavg.t | 2 |
4 files changed, 5 insertions, 3 deletions
@@ -1,6 +1,8 @@ Revision history for Perl extension {{$dist->name}}: {{$NEXT}} + [Enhancements] + - Support getloadavg for DragonFly BSD. 0.22 2020-03-27 12:51:39+00:00 Europe/London (TRIAL RELEASE) [Enhancements] @@ -19,7 +19,7 @@ getloadavg() double loadavg[3]; int nelem; PPCODE: -#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__linux__) || defined(__sun) +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__linux__) || defined(__sun) || defined(__DragonFly__) nelem = getloadavg(loadavg, 3); #else nelem = -1; diff --git a/lib/Sys/CpuLoad.pm b/lib/Sys/CpuLoad.pm index ffa60fd..6bc878e 100644 --- a/lib/Sys/CpuLoad.pm +++ b/lib/Sys/CpuLoad.pm @@ -124,7 +124,7 @@ sub BEGIN { my $this = __PACKAGE__; my $os = lc $^O; - if ( $os =~ /^(darwin|(free|net|open)bsd|linux|solaris|sunos)$/ ) { + if ( $os =~ /^(darwin|dragonfly|(free|net|open)bsd|linux|solaris|sunos)$/ ) { no strict 'refs'; ## no critic (ProhibitNoStrict) *{"${this}::load"} = \&getloadavg; } diff --git a/t/10-getloadavg.t b/t/10-getloadavg.t index 6e4b3c0..faf66e1 100644 --- a/t/10-getloadavg.t +++ b/t/10-getloadavg.t @@ -3,7 +3,7 @@ use Test::Most; my $os = lc $^O; plan skip_all $os - if $os !~ /^(darwin|(free|net|open)bsd|linux|solaris|sunos)$/; + if $os !~ /^(darwin|dragonfly|(free|net|open)bsd|linux|solaris|sunos)$/; use_ok 'Sys::CpuLoad', 'getloadavg'; |