diff --git a/bindings/perl/Sigar.xs b/bindings/perl/Sigar.xs index 25c9fb37..f5170ce8 100644 --- a/bindings/perl/Sigar.xs +++ b/bindings/perl/Sigar.xs @@ -6,7 +6,7 @@ #include "sigar_fileinfo.h" typedef sigar_t * Sigar; -typedef sigar_uint64_t Sigar__NetAddr; +typedef sigar_net_address_t Sigar__NetAddress; /* generated list */ typedef sigar_uptime_t * Sigar__Uptime; @@ -34,6 +34,7 @@ typedef sigar_who_t * Sigar__Who; typedef sigar_thread_cpu_t * Sigar__ThreadCpu; typedef sigar_resource_limit_t * Sigar__ResourceLimit; typedef sigar_net_info_t * Sigar__NetInfo; +typedef sigar_dir_usage_t * Sigar__DirUsage; /* Perl < 5.6 */ #ifndef aTHX_ @@ -316,11 +317,12 @@ proc_env(sigar, pid, key=NULL) procenv.data = hv = newHV(); } else { + STRLEN len = get.klen; procenv.type = SIGAR_PROC_ENV_KEY; procenv.env_getter = proc_env_getvalue; procenv.data = &get; get.val = &PL_sv_undef; - get.key = SvPV(key, get.klen); + get.key = SvPV(key, len); procenv.key = get.key; procenv.klen = get.klen; } diff --git a/bindings/perl/lib/Sigar/ArchName.pm b/bindings/perl/lib/Sigar/ArchName.pm index 14749fac..c4430e6c 100644 --- a/bindings/perl/lib/Sigar/ArchName.pm +++ b/bindings/perl/lib/Sigar/ArchName.pm @@ -16,22 +16,22 @@ sub get_name { } elsif ($os =~ /hpux/) { if ($vers =~ /11\./) { - return 'hppa2.0-hp-hpux-11.x'; + return 'pa-hpux-11'; } } elsif ($os =~ /aix/) { - return 'powerpc-ibm-aix-4.3.x'; + return 'ppc-aix-5'; } elsif ($os =~ /solaris/) { if ($arch =~ /sun4/) { - return 'sparc-sun-solaris-2.x'; + return 'sparc-solaris'; } elsif ($arch =~ /.86/) { - return 'x86-sun-solaris-2.x'; + return 'x86-solaris'; } } elsif ($os =~ /darwin/) { - return 'powerpc-apple-darwin'; + return 'universal-macosx'; } die "Unsupported platform"; diff --git a/bindings/perl/typemap b/bindings/perl/typemap index d6499d5f..caef88cc 100644 --- a/bindings/perl/typemap +++ b/bindings/perl/typemap @@ -2,7 +2,7 @@ Sigar T_PTROBJ sigar_pid_t T_UV sigar_uint64_t T_UV const char * T_PV -Sigar::NetAddr T_NETADDR +Sigar::NetAddress T_NETADDR #generated list Sigar::Uptime T_PTROBJ @@ -30,11 +30,12 @@ Sigar::Who T_PTROBJ Sigar::ThreadCpu T_PTROBJ Sigar::ResourceLimit T_PTROBJ Sigar::NetInfo T_PTROBJ +Sigar::DirUsage T_PTROBJ OUTPUT T_NETADDR { - char addr_str[SIGAR_INET_ADDR_LEN]; - sigar_inet_ntoa(NULL, $var, addr_str); + char addr_str[INET6_ADDRSTRLEN]; + sigar_net_address_to_string(NULL, &$var, addr_str); sv_setpv($arg, addr_str); }