You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by au...@apache.org on 2006/07/07 20:31:00 UTC

svn commit: r419948 - /perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm

Author: autarch
Date: Fri Jul  7 11:31:00 2006
New Revision: 419948

URL: http://svn.apache.org/viewvc?rev=419948&view=rev
Log:
Fix for shared size calculations on BSD from Phil G.

Modified:
    perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm

Modified: perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm
URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm?rev=419948&r1=419947&r2=419948&view=diff
==============================================================================
--- perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm (original)
+++ perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm Fri Jul  7 11:31:00 2006
@@ -247,8 +247,15 @@
     return ( $size, 0 );
 }
 
+# rss is in KB but ixrss is in BYTES.
+# This is true on at least FreeBSD, OpenBSD, NetBSD, and Darwin - Phil
+# Gollucci
 sub _bsd_size_check {
-    return ( BSD::Resource::getrusage() )[ 2, 3 ];
+    my @results = BSD::Resource::getrusage();
+    my $max_rss   = $results[2];
+    my $max_ixrss = int ( $results[3] / 1024 );
+
+    return ( $max_rss, $max_ixrss );
 }
 
 sub _win32_size_check {