From f03648e2d817af6fcc0133a35b9bb35d39f579c6 Mon Sep 17 00:00:00 2001 From: Steve Wills Date: Sat, 29 Jan 2011 20:00:32 +0000 Subject: Sys::Load - Perl module for getting the current system load and uptime WWW: http://search.cpan.org/dist/Sys-Load/ PR: ports/154139 Submitted by: Konstantin Menshikov Approved by: pgollucci (mentor) Feature safe: yes --- sysutils/p5-Sys-Load/files/patch-Load.xs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sysutils/p5-Sys-Load/files/patch-Load.xs (limited to 'sysutils/p5-Sys-Load/files/patch-Load.xs') diff --git a/sysutils/p5-Sys-Load/files/patch-Load.xs b/sysutils/p5-Sys-Load/files/patch-Load.xs new file mode 100644 index 000000000000..4e92cc0ffd9a --- /dev/null +++ b/sysutils/p5-Sys-Load/files/patch-Load.xs @@ -0,0 +1,27 @@ +--- Load.xs 2002-08-31 02:00:32.000000000 +0000 ++++ Load.xs 2011-01-19 12:07:14.000000000 +0000 +@@ -2,6 +2,7 @@ + #include "perl.h" + #include "XSUB.h" + #include "stdlib.h" ++#include + + + MODULE = Sys::Load PACKAGE = Sys::Load +@@ -22,3 +23,16 @@ + XPUSHs(sv_2mortal(newSVnv(load[2]))); + } + ++void ++uptime() ++PROTOTYPE: ++PREINIT: ++ struct timespec t; ++ int i; ++PPCODE: ++ i = clock_gettime(CLOCK_MONOTONIC, &t); ++ if(i == -1) ++ XSRETURN_EMPTY; ++ else { ++ XPUSHs(sv_2mortal(newSVnv(t.tv_sec))); ++ } -- cgit v1.2.3