From 6a926ec91db98b7ab0632da01f58879f0bc3ad78 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 22 Feb 2007 03:52:03 +0000 Subject: [PATCH] Perl binding updates Submitted by: Nicolas Laurent --- ChangeLog | 3 +++ bindings/perl/Sigar.xs | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/ChangeLog b/ChangeLog index 965415e0..31b2f034 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-02-21 Doug MacEachern + * Perl binding updates + Submitted by: Nicolas Laurent + * [SIGAR-45] Fix disk reads/writes for LVM managed volumes 2007-02-15 Doug MacEachern diff --git a/bindings/perl/Sigar.xs b/bindings/perl/Sigar.xs index 53a01aff..8f30cda2 100644 --- a/bindings/perl/Sigar.xs +++ b/bindings/perl/Sigar.xs @@ -246,6 +246,31 @@ cpu_info_list(sigar) OUTPUT: RETVAL +SV * +cpu_list(sigar) + Sigar sigar + + PREINIT: + sigar_cpu_list_t cpus; + int status; + + CODE: + status = sigar_cpu_list_get(sigar, &cpus); + + if (status != SIGAR_OK) { + SIGAR_CROAK(sigar, "cpu_list"); + } + + RETVAL = convert_2svav((char *)&cpus.data[0], + cpus.number, + sizeof(*cpus.data), + "Sigar::Cpu"); + + sigar_cpu_list_destroy(sigar, &cpus); + + OUTPUT: + RETVAL + SV * proc_list(sigar) Sigar sigar