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/11 15:42:59 UTC

svn commit: r420843 - in /perl/Apache-SizeLimit/trunk: Changes Makefile.PL lib/Apache/SizeLimit.pm t/apache/all.t

Author: autarch
Date: Tue Jul 11 06:42:58 2006
New Revision: 420843

URL: http://svn.apache.org/viewvc?rev=420843&view=rev
Log:
Removed support for Darwin OS (OSX). Added a note to the docs
explaining why.

Modified:
    perl/Apache-SizeLimit/trunk/Changes
    perl/Apache-SizeLimit/trunk/Makefile.PL
    perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm
    perl/Apache-SizeLimit/trunk/t/apache/all.t

Modified: perl/Apache-SizeLimit/trunk/Changes
URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/Changes?rev=420843&r1=420842&r2=420843&view=diff
==============================================================================
--- perl/Apache-SizeLimit/trunk/Changes (original)
+++ perl/Apache-SizeLimit/trunk/Changes Tue Jul 11 06:42:58 2006
@@ -51,6 +51,10 @@
 Fixed calculation of shared memory on BSD.
 [Philip M. Gollucci <pg...@p6m7g8.com>]
 
+Removed support for OSX, because testing shows that BSD::Resource is
+not working on that platform.
+[Dave Rolsky <au...@urth.org>]
+
 =item 0.05 mp2 core / not released
 
 =item 0.04 not released

Modified: perl/Apache-SizeLimit/trunk/Makefile.PL
URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/Makefile.PL?rev=420843&r1=420842&r2=420843&view=diff
==============================================================================
--- perl/Apache-SizeLimit/trunk/Makefile.PL (original)
+++ perl/Apache-SizeLimit/trunk/Makefile.PL Tue Jul 11 06:42:58 2006
@@ -12,7 +12,7 @@
             $prereqs{'Linux::Smaps'} = 0;
         }
     }
-    elsif ( $Config{'osname'} =~ /(bsd|aix|darwin)/i ) {
+    elsif ( $Config{'osname'} =~ /(bsd|aix)/i ) {
         $prereqs{'BSD::Resource'} = 0;
     }
     elsif ( $Config{'osname'} eq 'MSWin32' ) {

Modified: perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm
URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm?rev=420843&r1=420842&r2=420843&view=diff
==============================================================================
--- perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm (original)
+++ perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm Tue Jul 11 06:42:58 2006
@@ -192,8 +192,8 @@
             *_platform_check_size = \&_linux_size_check;
         }
     }
-    elsif ( $Config{'osname'} =~ /(?:bsd|aix|darwin)/i ) {
-        # will getrusage work on all BSDs?  I should hope so.
+    elsif ( $Config{'osname'} =~ /(?:bsd|aix)/i ) {
+        # on OSX, getrusage() is returning 0 for proc & shared size.
         _load('BSD::Resource');
 
         *_platform_check_size   = \&_bsd_size_check;
@@ -248,8 +248,7 @@
 }
 
 # rss is in KB but ixrss is in BYTES.
-# This is true on at least FreeBSD, OpenBSD, NetBSD, and Darwin - Phil
-# Gollucci
+# This is true on at least FreeBSD, OpenBSD, & NetBSD - Phil Gollucci
 sub _bsd_size_check {
     my @results = BSD::Resource::getrusage();
     my $max_rss   = $results[2];
@@ -597,6 +596,10 @@
 Uses C<BSD::Resource::getrusage()> to determine process size.  This is
 pretty efficient (a lot more efficient than reading it from the
 F</proc> fs anyway).
+
+According to recent tests on OSX (July, 2006), C<BSD::Resource> simply
+reports zero for process and shared size on that platform, so OSX is
+not supported by C<Apache::SizeLimit.
 
 =head2 AIX?
 

Modified: perl/Apache-SizeLimit/trunk/t/apache/all.t
URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/t/apache/all.t?rev=420843&r1=420842&r2=420843&view=diff
==============================================================================
--- perl/Apache-SizeLimit/trunk/t/apache/all.t (original)
+++ perl/Apache-SizeLimit/trunk/t/apache/all.t Tue Jul 11 06:42:58 2006
@@ -19,7 +19,7 @@
             $ok &= need_module('Linux::Smaps');
         }
     }
-    elsif ( $Config{'osname'} =~ /(bsd|aix|darwin)/i ) {
+    elsif ( $Config{'osname'} =~ /(bsd|aix)/i ) {
         $ok &= need_module('BSD::Resource');
     }
     elsif ( $Config{'osname'} eq 'MSWin32' ) {